Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

error.Error.kind

Rust
  • Python Unavailable
  • TypeScript Unavailable
  • Rust
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

View as Markdown

Module
error
Declared in
Error
Package
libtmux
Source
crates/libtmux/src/error/classification.rs
kind ( self ) → ErrorKind
method [source]
method [source]
kind

Return what this failure means for the caller.

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

0 declared, 0 inherited

Esc

Type to search.