# LibTmux.Protocol

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/66b9b1c3f3f3186428abdfda2c76f5cf87446710/lib/libtmux/protocol.ex#L1
- **Page:** https://libtmux.org/en/elixir/latest/reference/libtmux-protocol/

Assembles bounded control-mode replies and lexical notifications from bytes.

Reply guards retain timestamp, command number and flags. Inside a block,
notification-looking output stays data. The parser cannot authenticate
injected matching guards: shared lanes must separately qualify commands,
hooks and subscription expansion. Notification payloads need semantic
validation before they can update a graph.

A parse error retains already completed events in `error.details.events`.
Its owner must retire the lane rather than reuse the rejected state.

## Members

### Other members

- [`event/0`](/en/elixir/latest/reference/libtmux-protocol-event-0/) (typealias): A framed reply or lexical notification. Payloads still require semantic validation before graph updates.
- [`feed/2`](/en/elixir/latest/reference/libtmux-protocol-feed-2/) (function): Consumes one byte chunk without performing I/O.
- [`finish/1`](/en/elixir/latest/reference/libtmux-protocol-finish-1/) (function): Rejects a stream ending inside a line or reply block.
- [`guard_id/0`](/en/elixir/latest/reference/libtmux-protocol-guard_id-0/) (typealias): A complete tmux reply guard: timestamp, command number and flags, retained for correlation.
- [`new/1`](/en/elixir/latest/reference/libtmux-protocol-new-1/) (function): Constructs a parser with positive byte, line and event limits.
- [`option/0`](/en/elixir/latest/reference/libtmux-protocol-option-0/) (typealias): A positive parser ceiling, measured in bytes, lines or emitted events as named.
- [`t/0`](/en/elixir/latest/reference/libtmux-protocol-t-0/) (typealias): Immutable parser carry and bounded in-flight frame state; discard it after any parse error.
