# target.ServerIdentity

- **Module:** target
- **Package:** libtmux
- **Language:** Rust
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/target.rs#L348
- **Page:** https://libtmux.org/en/rs/latest/reference/target-serveridentity/

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.

## Example

```rust
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?;
```
