# session.Session.get

- **Module:** session.Session
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/session.rs#L905
- **Page:** https://libtmux.org/en/rs/latest/reference/session-session-get/

```
session.Session.get(self, field: F) -> Availability<F::Value<'_>>
```

Read one field of this session's snapshot, named by the handle that filters it.

Every field in [`SessionFields`] reads this way, including those with no
getter of their own. Nothing is sent to tmux, so the value is as old as
the snapshot. The result says why a field holds no value: see
[`Availability`].

## Example

```rust
use libtmux::query::Filterable as _;
use libtmux::{Availability, Session};

let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("read").await?;
let fields = Session::filter_fields();

// Nobody is attached, so nobody is attached twice.
assert_eq!(session.get(fields.session_many_attached), Availability::Available(false));
assert_eq!(session.get(fields.session_id), Availability::Available(session.id()));

guard.shutdown().await?;
```
