Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

snapshot.Availability

Rust
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

View as Markdown

Module
snapshot
Package
libtmux
Source
crates/libtmux/src/snapshot.rs
enum snapshot.Availability
enumoverload [source]
enumoverload [source]
enum snapshot.Availability

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, gives Unproven for any field newer than the oldest supported release. Neither is fetched.

Absent means tmux was asked and answered with nothing, which for some fields is the ordinary state: a pane outside copy mode has no scroll_position , and a pane straight from Pane::split can report no pane_current_path until 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.
Esc

Type to search.