error.ServerGoneKind
Rust
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- error
- Package
- libtmux
- Source
- crates/libtmux/src/error.rs
-
Which way a tmux server was not there.
The four are one decision -- there is no server -- and four different stories about how, which is the difference between a socket nobody has started and a server that died under the command being run.
Examples
use libtmux::{Error, ServerGoneKind};fn advise(error: &Error) -> &'static str {match error {Error::ServerGone { kind, .. } => match kind {ServerGoneKind::NotRunning => "start one",ServerGoneKind::Unreachable => "check the socket path",ServerGoneKind::Lost | ServerGoneKind::Stopped => "it went away mid-command",_ => "there is no server",},_ => "not a server problem",}}let absent = Error::ServerGone {command: "list-sessions",kind: ServerGoneKind::NotRunning,};assert_eq!(advise(&absent), "start one");
4 declared, 0 inherited
Members
- Lost constant The connection was lost with the command in flight, which is a server that crashed or was killed.
- NotRunning constant Nothing was listening on the socket.
- Stopped constant The server shut down with the command in flight.
- Unreachable constant The socket was there and the connection to it failed.