# snapshot.ReadField

- **Module:** snapshot
- **Package:** libtmux
- **Language:** Rust
- **Kind:** trait
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/snapshot.rs#L250
- **Page:** https://libtmux.org/en/rs/latest/reference/snapshot-readfield/

A field handle whose value a `Target` snapshot holds.

Every handle in [`PaneFields`], [`WindowFields`], [`SessionFields`] and
[`ClientFields`] implements it for the handle type it filters, so the name
that filters a field also reads it: pass the handle to
[`Pane::get`](crate::Pane::get), [`Window::get`](crate::Window::get),
[`Session::get`](crate::Session::get) or
[`Client::get`](crate::Client::get). A read never asks tmux. The trait is
sealed.

## Example

```rust
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);
```
