Snapshot
An indexed immutable graph observed over a capture interval.
Source and package
- Qualified name
-
LibTmux .Snapshot - Module
- LibTmux
- Package
- libtmux
- Source
- lib/libtmux/snapshot.ex
-
Description#
Construction and traversal perform no I/O.
fieldsdeclares loaded fields over the supplied entity IDs;completedeclares complete server entity sets. Missing declarations remain unloaded, including on empty sets. Unavailable capabilities use a separate declaration. Relations require complete join domains. A snapshot reserves no tmux objects.Discussed in Read values, execute explicitly , Captured tmux state · Getting started
Members31#
Collections and queries8#
- sessions/1 function Returns a materialized session selection without I/O.
- windows/1 function Returns a materialized physical window selection without I/O.
- panes/1 function Returns a materialized physical pane selection without I/O.
- clients/1 function Returns a materialized attached-client selection without I/O.
- sessions: %{optional(String
.t ()) => LibTmux ()} property.Session .t - windows: %{optional(String
.t ()) => LibTmux ()} property.Window .t - panes: %{optional(String
.t ()) => LibTmux ()} property.Pane .t - clients: %{optional(String
.t ()) => LibTmux ()} property.Client .t
Common operations4#
- fetch/3 function Looks up one exact observed ID without I/O.
- items/2 function Returns plain observed items in stable identity order without loading data.
- new/2 function Validates observed rows, rejecting conflicts, invalid fields and dangling covered references.
- related/4 function Resolves one source's covered relation through captured indexes; never refreshes.
Other members19#
- captured_from: integer() property Required: building the struct without this key is an error.
- captured_until: integer() property Required: building the struct without this key is an error.
- coverage: coverage() property Required: building the struct without this key is an error.
- coverage/0: coverage() :: %{
entities: %{
required(Lib
Tmux ()) => entity.Schema .entity _coverage () } } typealias Declared entity sets and field availability; completeness is separate from an empty captured set. - entity_coverage/0: entity
_coverage () :: %{ ids: MapSet (Lib.t Tmux ()), complete: boolean(), fields: %{ optional(atom()) => :loaded | :unavailable } } typealias Coverage of one captured entity domain; missing field entries are unloaded..Ref .id - id: pos
_integer () property Required: building the struct without this key is an error. - indexes: indexes() property
- indexes/0 typealias Maps each session ID to the IDs of its window links and clients, and each window ID to the IDs of its window links and panes. Traverse with
related/4; the layout is not part of the contract. - option/0: option() ::
{:server_instance, String
.t ()} | {:captured_from, integer()} | {:captured_until, integer()} | {:fields, %{optional(LibTmux ()) => [atom()]}} | {:complete, [Lib.Schema .entity Tmux ()]} | {:unavailable, %{optional(Lib.Schema .entity Tmux ()) => [atom()]}} typealias Construction metadata: one server instance, ordered millisecond timestamps and explicit coverage declarations..Schema .entity - order: %{required(Lib
Tmux ()) => [Lib.Schema .entity Tmux ()]} property.Ref .id - require_complete!/2 function Requires a declared complete entity set, even when it has no rows.
- require_field!/3 function Requires a loaded field over the captured entity domain before evaluation.
- require_relation!/4 function Requires relation coverage for the requested source IDs, including known-empty relations.
- rows/0: rows() :: %{
optional(Lib
Tmux ()) => [ map() | Lib.Schema .entity Tmux () ] } typealias Observed rows grouped by canonical entity; construction validates and deduplicates their identities..Schema .observation - schema_version: 1 property
- server_instance: String
.t () property Required: building the struct without this key is an error. - t/0: t() :: %Lib
Tmux { captured_from: integer(), captured_until: integer(), clients: %{ optional(String.Snapshot .t ()) => LibTmux () }, coverage: coverage(), id: pos.Client .t _integer (), indexes: indexes(), order: %{ required(LibTmux ()) => [ Lib.Schema .entity Tmux () ] }, panes: %{optional(String.Ref .id .t ()) => LibTmux ()}, schema_version: 1, server_instance: String.Pane .t .t (), sessions: %{ optional(String.t ()) => LibTmux () }, window_links: %{ optional(Lib.Session .t Tmux ()) => Lib.Ref .id Tmux () }, windows: %{ optional(String.Window Link .t .t ()) => LibTmux () } } typealias An immutable observation interval with indexed entities and explicit coverage..Window .t - window_links: %{optional(Lib
Tmux ()) => Lib.Ref .id Tmux ()} property.Window Link .t - window_links/1 function Returns a materialized membership selection without I/O.