# server.Principal

- **Module:** server
- **Package:** libtmux
- **Language:** Rust
- **Kind:** enum
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/server.rs#L98
- **Page:** https://libtmux.org/en/rs/latest/reference/server-principal/

Whether an [`AccessRule`] names an operating-system user or group.

tmux originally listed only users. A later release let the server owner
add a whole group to the access list, and marks each listed entry `U` or
`G` so a caller can tell them apart. A release before that mark existed
prints a bare `name (R)`/`name (W)` line with no marker at all -- every row
such a release can print names a user, so decoding one reports
[`Principal::User`].

## Example

```rust
use libtmux::Principal;

for rule in server.access_rules().await? {
    match rule.principal() {
        Principal::User => println!("{} (user)", rule.name()),
        Principal::Group => println!("{} (group)", rule.name()),
    }
}
```

## Members

- `User` (constant): The entry names an operating-system user.
- `Group` (constant): The entry names an operating-system group.
