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.

Rust API

method libtmux-rs latest

Error.kind

Return what this failure means for the caller.

Source and package
Qualified name
libtmux::error::Error::kind
Module
error
Declared in
Error
Package
libtmux
Source
crates/libtmux/src/error/classification.rs
#[must_use] pub fn kind(&self) -> ErrorKind

Examples#

use libtmux::ErrorKind;
// The shape this exists for: use it if it is there, make it if not.
let session = match server.session("work").await? {
Some(session) => session,
None => server.new_session("work").await?,
};
// And when an operation races something else removing it. The handle
// is cloned because killing consumes one, which is how the crate
// stops you from using a window you just destroyed.
let window = session.new_window("doomed").await?;
let mut stale = window.clone();
window.kill().await?;
let error = stale.rename("gone").await.expect_err("the window was killed");
assert_eq!(error.kind(), ErrorKind::ObjectGone);
assert!(error.is_object_gone());
Esc

Type to search.

Reference previewOpen reference