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

Principal

Whether an AccessRule names an operating-system user or group.

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

Description#

tmux originally listed only users. A later release let the server owner add a whole group to the access list, and marks each listed entry U or G so a caller can tell them apart. A release before that mark existed prints a bare name (R)/name (W) line with no marker at all -- every row such a release can print names a user, so decoding one reports Principal::User.

Examples#

use libtmux::Principal;
for rule in server.access_rules().await? {
match rule.principal() {
Principal::User => println!("{} (user)", rule.name()),
Principal::Group => println!("{} (group)", rule.name()),
}
}

Variants2#

Principal variants
CasePayloadDescription
Group No payload The entry names an operating-system group.
User No payload The entry names an operating-system user.
Esc

Type to search.

Reference previewOpen reference