libtmux Reference MCP Search
On this page

formats.text.TmuxText

View as Markdown

Module
formats.text
Package
libtmux
Source
crates/libtmux/src/formats/text.rs
struct formats.text.TmuxText
structoverload [source]
structoverload [source]
struct formats.text.TmuxText

Compare tmux bytes against a string without converting either.

tmux text is bytes, but the thing it is usually compared against is a literal. Requiring as_bytes() at every comparison put the burden on the common case to serve the rare one.

Text that is not valid UTF-8 never equals a str , which is the honest answer: a str cannot hold those bytes, so nothing it contains can match.

Examples

use libtmux::TmuxText;

assert_eq!(TmuxText::from("editor"), *"editor");
assert!(TmuxText::from("editor") == "editor");
assert!(TmuxText::from(vec![0xff]) != "\u{fffd}");

6 declared, 0 inherited

Members

Esc

Type to search.