# snapshot.Availability.as_ref

- **Module:** snapshot.Availability
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/snapshot.rs#L83
- **Page:** https://libtmux.org/en/rs/latest/reference/snapshot-availability-as_ref/

```
snapshot.Availability.as_ref(self) -> Availability<&T>
```

Borrow the value, keeping the reason when there is none.

## Example

```rust
use libtmux::{Availability, TmuxText};

let owned = Availability::Available(TmuxText::from("copy-mode"));
assert_eq!(owned.as_ref().available(), Some(&TmuxText::from("copy-mode")));
```
