# `LibTmux.Ref`
[🔗](https://github.com/libtmux/libtmux-elixir/blob/b72452c198917433229bdc266a68c163541b6127/lib/libtmux/ref.ex#L1)

An exact observed target bound to one server instance.

A window-link ID is its observed `{session_id, index, window_id}` binding,
not a unique lifetime identifier. Validation detects known stale instances;
it does not reserve an object or close a one-shot check/use race.

# `entity`

```elixir
@type entity() :: :session | :window | :pane | :window_link | :client
```

The target kind; physical windows and session-relative links have different identities.

# `id`

```elixir
@type id() :: String.t() | {String.t(), non_neg_integer(), String.t()}
```

A native ID or observed session/index/window link binding; neither reserves an object's lifetime.

# `t`

```elixir
@type t() :: %LibTmux.Ref{entity: entity(), id: id(), server_instance: String.t()}
```

An exact observed identity bound to a tmux server incarnation, separate from a connection epoch.

# `new`

```elixir
@spec new(entity(), id(), String.t()) :: {:ok, t()} | {:error, LibTmux.Error.t()}
```

Validates a native identity and binds it to a nonempty instance token.

# `validate`

```elixir
@spec validate(t(), String.t()) :: :ok | {:error, LibTmux.Error.t()}
```

Rejects malformed references and known server-instance mismatches.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
