Core LibraryalphaAPI Reference

Choose documentation 3

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Rust API

method libtmux-rs latest

Server.validate_layouts

Validate every planned layout before scripts or tmux mutations.

Source and package
Qualified name
server.Server.validate_layouts
Module
server
Declared in
Server
Package
libtmux
Source
crates/libtmux/src/server.rs
pub async fn validate_layouts<'a>( &self, layouts: impl IntoIterator<Item = (&'a OsStr, usize)>, ) -> Result<(), Error>

Description#

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#

use std::ffi::OsStr;
server.validate_layouts([(OsStr::new("even-h"), 2)]).await?;
Type parameters
Parameters
Esc

Type to search.

Reference preview Open reference