#[non_exhaustive]pub enum ErrorKind {
ObjectGone,
Refused,
ServerGone,
Timeout,
Unreachable,
UnsupportedVersion,
InvalidInput,
Transport,
Decode,
}Expand description
What a failure means for the caller.
Error carries the detail; this carries the decision. Each variant is a
different thing to do about it, which is why there are fewer of these than
there are error variants.
New kinds may be added, so match with a _ arm.
§Examples
use libtmux::ErrorKind;
fn retryable(kind: ErrorKind) -> bool {
matches!(kind, ErrorKind::Timeout | ErrorKind::Transport)
}
assert!(retryable(ErrorKind::Transport));
assert!(!retryable(ErrorKind::ObjectGone));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ObjectGone
The object is not on the server. Look it up again, or create it.
Refused
tmux ran the command and refused it. The arguments were wrong.
ServerGone
No tmux server answered. Start one, or name the socket that has it.
Timeout
The command did not finish in time. Retry, or allow longer.
Unreachable
tmux could not be run at all: not installed, or not where the server was told to look. Nothing about the request will change this.
UnsupportedVersion
The tmux that answered is older than this crate supports.
InvalidInput
The caller passed something that cannot be sent to tmux.
Transport
The process or connection carrying the command failed. Usually the environment rather than the request, so retrying may work.
Decode
tmux answered in a shape the crate could not read. Worth reporting.