#[non_exhaustive]pub enum ErrorKind {
PartialEffect,
ObjectGone,
Refused,
ServerGone,
Timeout,
Unreachable,
UnsupportedVersion,
InvalidInput,
Transport,
Decode,
}Expand description
A coarse failure category for reporting and routing.
Error carries the recovery detail. One category can contain failures
with different retry scopes: overload and a bad argument are both refused,
while executor shutdown and a failed child pipe are both transport errors.
Use Error::is_transient before repeating a call unchanged.
New kinds may be added, so match with a _ arm.
§Examples
use libtmux::ErrorKind;
fn target_is_stale(kind: ErrorKind) -> bool {
matches!(kind, ErrorKind::ObjectGone)
}
assert!(target_is_stale(ErrorKind::ObjectGone));
assert!(!target_is_stale(ErrorKind::InvalidInput));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PartialEffect
tmux accepted an effectful step before a later part of the operation failed.
ObjectGone
The object is not on the server. Look it up again, or create it.
Refused
The operation was refused before or by tmux.
ServerGone
No tmux server answered. Start one, or name the socket that has it.
Timeout
The operation did not finish in time.
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 supplied inputs that cannot form a valid operation.
Transport
The process, connection, or executor carrying the command failed.
Decode
tmux answered in a shape the crate could not read. Worth reporting.