ReadField
A field handle whose value a Target snapshot holds.
Source and package
- Qualified name
-
libtmux::snapshot:: Read Field - Module
- snapshot
- Package
- libtmux
- Source
- crates/libtmux/src/snapshot.rs
-
Description#
Every handle in
PaneFields,WindowFields,SessionFieldsandClientFieldsimplements it for the handle type it filters, so the name that filters a field also reads it: pass the handle toPane::get(),Window::get(),Session::get()orClient::get(). A read never asks tmux. The trait is sealed.Examples#
use libtmux::query::{Filterable as _, ReadField};use libtmux::{Availability, Pane};// Any field of a pane, read the same way.fn read<F: ReadField<Pane>>(pane: &Pane, field: F) -> Availability<F::Value<'_>> {pane.get(field)}let fields = Pane::filter_fields();let column: Availability<u32> = read(pane, fields.cursor_x);