ServerGoneKind
Which way a tmux server was not there.
Source and package
- Qualified name
-
libtmux::error:: Server Gone Kind - Module
- error
- Package
- libtmux
- Source
- crates/libtmux/src/error.rs
-
Description#
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");
Variants4#
| Case | Payload | Description |
|---|---|---|
| Lost | No payload | The connection was lost with the command in flight, which is a server that crashed or was killed. |
| NotRunning | No payload | Nothing was listening on the socket. |
| Stopped | No payload | The server shut down with the command in flight. |
| Unreachable | No payload | The socket was there and the connection to it failed. |