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.
Summary
Types
A framed reply or lexical notification. Payloads still require semantic validation before graph updates.
A complete tmux reply guard: timestamp, command number and flags, retained for correlation.
A positive parser ceiling, measured in bytes, lines or emitted events as named.
Immutable parser carry and bounded in-flight frame state; discard it after any parse error.
Functions
Consumes one byte chunk without performing I/O.
Rejects a stream ending inside a line or reply block.
Constructs a parser with positive byte, line and event limits.
Types
@type event() :: {:reply, :ok | :error, guard_id(), [binary()]} | {:notification, atom(), binary()} | {:unknown, binary()}
A framed reply or lexical notification. Payloads still require semantic validation before graph updates.
@type guard_id() :: {non_neg_integer(), non_neg_integer(), non_neg_integer()}
A complete tmux reply guard: timestamp, command number and flags, retained for correlation.
@type option() :: {:max_chunk_bytes | :max_line_bytes | :max_frame_bytes | :max_frame_lines | :max_events, pos_integer()}
A positive parser ceiling, measured in bytes, lines or emitted events as named.
@opaque t()
Immutable parser carry and bounded in-flight frame state; discard it after any parse error.
Functions
@spec feed(t(), binary()) :: {:ok, [event()], t()} | {:error, LibTmux.Error.t()}
Consumes one byte chunk without performing I/O.
@spec finish(t()) :: :ok | {:error, LibTmux.Error.t()}
Rejects a stream ending inside a line or reply block.
Constructs a parser with positive byte, line and event limits.