Core LibraryalphaAPI Reference

Choose documentation 1

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

struct libtmux-elixir latest

Protocol

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

Source and package
Qualified name
LibTmux.Protocol
Module
LibTmux
Package
libtmux
Source
lib/libtmux/protocol.ex
struct LibTmux.Protocol

Description#

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.

Discussed in Command and field encoding

Members7#

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

Type to search.

Reference preview Open reference