# formats.text.TmuxText

- **Module:** formats.text
- **Package:** libtmux
- **Language:** Rust
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/formats/text.rs#L25
- **Page:** https://libtmux.org/en/rs/latest/reference/formats-text-tmuxtext/

Immutable text bytes returned by tmux.

`TmuxText` preserves bytes exactly. Callers choose whether to inspect the
raw bytes, require UTF-8, or decode lossily.
[`AsRef<[u8]>`] borrows those bytes, including invalid UTF-8, so accessor
results can be passed directly to name lookups such as [`crate::Server::session`].

## Example

```rust
use libtmux::TmuxText;

let borrowed = TmuxText::from("session");
let owned = TmuxText::from(String::from("window"));
let bytes = TmuxText::from(vec![b'p', 0xff]);

assert_eq!(borrowed.as_bytes(), b"session");
assert_eq!(owned.as_bytes(), b"window");
assert_eq!(bytes.as_bytes(), [b'p', 0xff]);
```

## Members

- `from_bytes` (method): Construct a value without validating or changing its bytes.
- `as_bytes` (method): Return the exact stored bytes.
- `as_str` (method): Borrow the stored bytes as UTF-8.
- `to_string_lossy` (method): Decode the stored bytes with replacement characters for invalid UTF-8.
- `as_flag` (method): Interpret these bytes as a tmux flag.
- `parse` (method): Parse these bytes as any type that reads from a string.
