snapshot.Availability
Rust
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- snapshot
- Package
- libtmux
- Source
- crates/libtmux/src/snapshot.rs
-
A snapshot field's value, or the reason the snapshot holds none.
A listing asks tmux for every field its snapshot models, except one the running tmux cannot have: a release older than the field gives
Unsupported, and a development build, which names no release to compare, givesUnprovenfor any field newer than the oldest supported release. Neither is fetched.Absentmeans tmux was asked and answered with nothing, which for some fields is the ordinary state: a pane outside copy mode has noscroll_position, and a pane straight fromPane::splitcan report nopane_current_pathuntil its process has started. tmux prints the same empty string for "no value" and "not yet", so re-reading is the only way to tell them apart.Every snapshot fetches every field it models, so no variant means "this snapshot did not ask".
Examples
use libtmux::Availability;fn describe(scroll: Availability<i32>) -> String {match scroll {Availability::Available(lines) => format!("{lines} lines up"),Availability::Absent => String::from("not in copy mode"),_ => String::from("this tmux cannot say"),}}assert_eq!(describe(Availability::Available(3)), "3 lines up");assert_eq!(Availability::Available(3).available(), Some(3));assert_eq!(Availability::<i32>::Absent.available(), None);
7 declared, 0 inherited
Members
- as_ref method Borrow the value, keeping the reason when there is none.
- available method Return the value, discarding the reason when there is none.
- is_available method Report whether tmux reported a value.
- Absent constant tmux was asked and reported nothing.
- Available constant tmux reported a value, which for text may be empty.
- Unproven constant A development build names no release to prove the field exists, so it was not fetched.
- Unsupported constant The running tmux release predates the field, so it was not fetched.