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.

struct libtmux-rs latest

ServerIdentity

The structural identity of one tmux server endpoint.

Source and package
Qualified name
libtmux::target::ServerIdentity
Module
target
Package
libtmux
Source
crates/libtmux/src/target.rs
struct target.ServerIdentity

Description#

Equality and hashing use the captured absolute socket path. Debug output redacts that path so diagnostics do not disclose local filesystem details.

This is what makes two handles to the same server compare equal, and it is deliberately not enough to say the daemon behind them is the same one -- see ServerGeneration for that.

Examples#

let guard = libtmux::test::TestServer::new().await?;
let server = guard.server();
// Two handles to one endpoint share an identity, so they can key a map.
let second = server.clone();
assert_eq!(server.identity(), second.identity());
// The socket path never reaches diagnostics.
let rendered = format!("{:?}", server.identity());
assert!(rendered.contains("<redacted>"), "{rendered}");
assert!(!rendered.contains("/tmp/"), "{rendered}");
guard.shutdown().await?;
Esc

Type to search.

Reference previewOpen reference