pub struct ServerIdentity { /* private fields */ }Expand description
The structural identity of one tmux server endpoint.
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?;Trait Implementations§
Source§impl Clone for ServerIdentity
impl Clone for ServerIdentity
Source§fn clone(&self) -> ServerIdentity
fn clone(&self) -> ServerIdentity
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServerIdentity
impl Debug for ServerIdentity
impl Eq for ServerIdentity
Source§impl Hash for ServerIdentity
impl Hash for ServerIdentity
Auto Trait Implementations§
impl Freeze for ServerIdentity
impl RefUnwindSafe for ServerIdentity
impl Send for ServerIdentity
impl Sync for ServerIdentity
impl Unpin for ServerIdentity
impl UnsafeUnpin for ServerIdentity
impl UnwindSafe for ServerIdentity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more