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

CommandResult.request_id

Return the Core-scoped dispatch-request identity.

Source and package
Qualified name
libtmux::command::CommandResult::request_id
Module
command
Declared in
CommandResult
Package
libtmux
Source
crates/libtmux/src/command.rs
#[must_use] pub const fn request_id(&self) -> u64

Description#

The Core allocates this value before validation, so an error can expose an ID even when no process was spawned. Clones of one crate::Server share the allocating Core. The ID is not globally unique, a process ID, an internal attempt ID, or a control-mode protocol-block ID.

Examples#

let server = libtmux::Server::builder().socket_path("/tmp/libtmux-rs-test/result-id.sock").build()?;
let result = server.cmd(libtmux::Command::new("list-sessions")).await?;
assert!(result.request_id() > 0);
server.shutdown().await?;
Esc

Type to search.

Reference previewOpen reference