Error
An error returned by libtmux.
Source and package
- Qualified name
-
libtmux::error:: Error - Module
- error
- Package
- libtmux
- Source
- crates/libtmux/src/error.rs
-
Description#
Request-bearing variants expose a Core-scoped dispatch-request identity. The Core allocates it before validation, so an error may carry an identity even when no process was spawned. Clones of one
crate::Servershare the allocating Core; independently constructed servers do not share its scope. The identity is not globally unique, a process ID, an internal attempt ID, or a control-mode protocol-block ID.Examples#
use libtmux::ErrorKind;let guard = libtmux::test::TestServer::new().await?;let doomed = guard.server().new_session("doomed").await?;let mut stale = doomed.clone();guard.server().new_session("survivor").await?;doomed.kill().await?;// A handle outliving its object is the normal way this fails, so// `is_object_gone` is the branch most callers write.let failure = stale.rename("renamed").await.expect_err("the session is gone");assert!(failure.is_object_gone());assert_eq!(failure.kind(), ErrorKind::ObjectGone);guard.shutdown().await?;
Variants43#
| Case | Payload | Description |
|---|---|---|
| OptionScopeMismatch | { option: String, requested: crate:: | The handle's scope is not one tmux keeps this option in. |
| AfterEffect | Not extracted | tmux accepted an effectful step before a later part of the operation failed. |
| AmbiguousLayout | { input: String, candidates: Vec<&'static str> } | A saved layout value is a preset prefix that names more than one preset on the running tmux release. |
| CapabilityDefective | { capability: &'static str, found: Tmux | tmux has this capability and the running release gets it wrong. |
| ClientSuspended | { name: String } | A client is stopped rather than gone, so listings leave it out. |
| CommandFailed | { command: &'static str, exit_code: Option<i32>, stderr: String } | tmux rejected a command that the crate requires to succeed. |
| ControlMode | Not extracted | A control-mode connection failed. |
| ControlModeFrameTooLarge | { frame: &'static str, limit: usize } | A control-mode frame grew past what the connection admits. |
| DecodeListing | { list_command: &'static str, detail: Listing | tmux listing output could not be decoded into typed snapshots. |
| DuplicateRequest | { request_id: u64, command: Command | A Core-scoped dispatch-request identity is already active in this executor. |
| ExecutableNotFound | Not extracted | The configured tmux executable was not found. |
| ExecutorShutdown | { request_id: u64, command: Command | The executor has stopped accepting requests. |
| InvalidCommandInput | { request_id: u64, input: &'static str } | A command or executable contained a byte that cannot be passed to a process. |
| InvalidLayout | { reason: &'static str } | A layout is unsafe to dispatch or cannot hold the planned panes. |
| InvalidPlan | Not extracted | A plan has a dependency that cannot be resolved before dispatch. |
| InvalidServerConfiguration | { kind: Server | A server builder value was invalid. |
| InvalidVersionOutput | { output_len: usize } | What the version check read from tmux was not a version report. |
| LinkGone | { kind: Object | A target found nothing, which does not prove the object is gone. |
| NoEffect | { command: &'static str, stderr: String } | A creating command exited 0 without creating anything. |
| ObjectGone | { kind: Object | A refresh could not find the object it was asked to update. |
| OptionRejected | { kind: Option | tmux would not accept an option name or value. |
| OptionValueRefused | { option: &'static str, reason: crate:: | A typed option write that tmux's option table refuses, so nothing was sent. |
| OutputLimitExceeded | { request_id: u64, command: Command | tmux produced more output than the dispatch was allowed to read. |
| Overloaded | { request_id: u64, command: Command | The server is already running as much work of this kind as it admits. |
| ReadOutput | { request_id: u64, command: Command | A captured output stream could not be drained. |
| RuntimeNested | No payload | A blocking runtime was driven from inside another runtime. |
| RuntimeUnavailable | Not extracted | A blocking runtime could not be created. |
| ServerGenerationChanged | { expected: crate:: | A different tmux daemon now holds this endpoint. |
| ServerGone | { command: &'static str, kind: Server | The tmux server the command needed was not there. |
| ServerMismatch | { operation: &'static str } | Handles passed to one operation belong to different tmux endpoints. |
| ServerReplaced | { request_id: u64, command: Command | The daemon was replaced between its version check and the request. |
| SessionExists | { name: String } | A session of this name already exists. |
| Spawn | Not extracted | The tmux process could not be started. |
| SupervisorLost | { request_id: u64, command: Command | The independent supervisor ended unexpectedly after cleaning up its child. |
| Timeout | { request_id: u64, command: Command | A tmux request exceeded its configured deadline. |
| UnreadableAccessRule | { marker: String } | A server-access -l line matched neither grammar tmux is known to print. |
| UnreadableFormatValue | { format: &'static str, detail: Id | tmux answered a format query with a value this crate cannot read. |
| UnrecognizedLayout | No payload | A saved layout value is not a preset name, a classic layout string, or a JSON layout. |
| UnrecognizedTmuxVersion | { found: Tmux | The daemon reported a version that names no release, such as a bare master, an openbsd-* build or 3.3a-dev. |
| UnsupportedCapability | { capability: &'static str, needs: Release | The running tmux is too old for a capability the caller asked for. |
| UnsupportedTmuxVersion | { found: Tmux | The detected tmux version does not meet the supported floor. |
| VersionProbeFailed | { request_id: u64, command: Command | The version probe could not establish the daemon's version. |
| WaitChild | Not extracted | The direct tmux child could not be awaited. |
Members7#
Common operations4#
- found_version method Return the detected version for a minimum-version error.
- invalid_version_output_len method Return the length of the invalid
tmux -Voutput, when present. - kind method Return what this failure means for the caller.
- minimum_version method Return the required release for a minimum-version error.
Other members3#
- after_effect method Mark this failure as following an effect that tmux accepted.
- is_object_gone method Report whether tmux no longer has the object the call named.
- is_transient method Report whether retrying the same call unchanged is safe and may succeed.
Guides#
Pages that discuss Error.