# server.Server.lock_all

- **Module:** server.Server
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/server.rs#L878
- **Page:** https://libtmux.org/en/rs/latest/reference/server-server-lock_all/

```
server.Server.lock_all(self) -> Result<(), Error>
```

Lock every client on the server.

Runs each client's `lock-command`, which is `lock -np` unless the
server was told otherwise. Succeeds when nobody is attached, having
locked nobody. [`crate::Session::lock`] narrows this to one session and
[`crate::Client::lock`] to one client.

# Errors

Returns an error when tmux refuses the command.
