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

session.Session.with_window

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

View as Markdown

Module
session
Declared in
Session
Package
libtmux
Source
crates/libtmux/src/session.rs
with_window ( self , options : impl Into<NewWindowOptions> , operation : impl AsyncFnOnce(&Window) -> Result<T, E> ) → Result<T, crate::ScopeError<T, E>>
method [source]
method [source]
with_window

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

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 window 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.

0 declared, 0 inherited

Esc

Type to search.