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

ErrorKind

A coarse failure category for reporting and routing.

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

Description#

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));

Variants10#

ErrorKind variants
CasePayloadDescription
Decode No payload tmux answered in a shape the crate could not read. Worth reporting.
InvalidInput No payload The caller supplied inputs that cannot form a valid operation.
ObjectGone No payload The object is not on the server. Look it up again, or create it.
PartialEffect No payload tmux accepted an effectful step before a later part of the operation failed.
Refused No payload The operation was refused before or by tmux.
ServerGone No payload No tmux server answered. Start one, or name the socket that has it.
Timeout No payload The operation did not finish in time.
Transport No payload The process, connection, or executor carrying the command failed.
Unreachable No payload 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 No payload The tmux that answered is older than this crate supports.
Esc

Type to search.

Reference previewOpen reference