Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

enum libtmux-rs latest

AccessMode

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

Source and package
Qualified name
libtmux::server::AccessMode
Module
server
Package
libtmux
Source
crates/libtmux/src/server.rs
enum server.AccessMode

Description#

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

Examples#

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);

Variants2#

AccessMode variants
CasePayloadDescription
ReadOnly No payload May attach and watch, but not act.
Write No payload May attach and act.
Esc

Type to search.

Reference previewOpen reference