# server.Server.validate_layouts

- **Module:** server
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/84de9258a07d10bdd5f6da01b016a9ae06fe1210/crates/libtmux/src/server.rs#L823
- **Page:** https://libtmux.org/en/rs/latest/reference/server-server-validate_layouts/

```
pub async fn validate_layouts<'a>(
    &self,
    layouts: impl IntoIterator<Item = (&'a OsStr, usize)>,
) -> Result<(), Error>
```

Validate every planned layout before scripts or tmux mutations.

Each item pairs layout bytes with the required pane count. Classic
layouts are checked for checksums, nonempty trees, unsigned fields and
depth up to 256 nested groups. tmux owns geometry correction and pruning.
JSON layouts require tmux 3.8-rc2 or newer; tmux validates their
contents. The version check queries the daemon even when no layouts need a version
check; a cold endpoint uses the selected executable. Unique name
abbreviations are accepted.

# Errors

Returns [`Error::InvalidLayout`] for invalid syntax, ambiguous names or
insufficient pane cells, [`Error::UnsupportedCapability`] for layouts
unavailable on the daemon, [`Error::UnsupportedTmuxVersion`] below the
core floor, or the version probe's transport/decode error.

## Examples

```rust
use std::ffi::OsStr;
server.validate_layouts([(OsStr::new("even-h"), 2)]).await?;
```

## Type parameters

- `'a`

## Parameters

- `&self`
- `layouts` (`impl IntoIterator<Item = (&'a OsStr, usize)>`)
