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.

method libtmux-rs latest

Window.with_pane

Create a pane, run an operation with it, then kill it.

Source and package
Qualified name
libtmux::window::Window::with_pane
Module
window
Declared in
Window
Package
libtmux
Source
crates/libtmux/src/window.rs
pub async fn with_pane<T, E>( &self, options: impl Into<SplitOptions>, operation: impl AsyncFnOnce(&Pane) -> Result<T, E>, ) -> Result<T, crate::ScopeError<T, E>>

Description#

crate::ScopeError retains creation, operation and cleanup failures separately. If operation and cleanup both fail, both original errors are returned. Cleanup errors carry Error::AfterEffect because creation succeeded.

Errors

Returns crate::ScopeError when creation, the operation, or cleanup fails. The operation's error needs no conversion into Error.

Cancel safety

Nothing is left behind. Once polled, creation and cleanup run in tasks of their own, so the pane is killed even if this future is dropped or the operation panics, while the Tokio runtime is alive. A cleanup failure then has no caller to reach; the tracing feature records it.

Type parameters
Parameters
Esc

Type to search.

Reference previewOpen reference