# server.Server.lock_all

- **Module:** server.Server
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/server.rs#L727
- **Page:** https://libtmux.org/reference/rs/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.
