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