Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

enum libtmux-rs latest

ServerGoneKind

Which way a tmux server was not there.

Source and package
Qualified name
libtmux::error::ServerGoneKind
Module
error
Package
libtmux
Source
crates/libtmux/src/error.rs
enum error.ServerGoneKind

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#

ServerGoneKind variants
CasePayloadDescription
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.
Esc

Type to search.

Reference previewOpen reference