# server.AccessMode

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

How much a user on the server's access list may do.

An enum rather than two flags because tmux's `-r` and `-w` are exclusive:
passing both is a contradiction the type makes unrepresentable.

## Example

```rust
use libtmux::AccessMode;

// Server access control is tmux 3.3 and later. `ReadOnly` lets another user
// watch without being able to send keys.
server.grant_access("observer", AccessMode::ReadOnly).await?;
server.grant_access("pair", AccessMode::Write).await?;

let rules = server.access_rules().await?;
assert_eq!(rules.len(), 2);
```

## Members

- `ReadOnly` (constant): May attach and watch, but not act.
- `Write` (constant): May attach and act.
