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

Rust API

Rust documentation

server.Server.with_session

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

View as Markdown

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

Create a session, 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 session 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.