A validated portable predicate over one observed entity type.
Keywords are trusted shorthand for maps. Fields in one object conjoin;
duplicate keyword keys are rejected recursively. not at a field negates
equality, while Boolean not takes one criteria object. Lists require an
explicit operator. Native callbacks belong to LibTmux.Selection.filter/2.
This value contains data; executable preparation remains separate.
Summary
Types
Local map criteria or keyword shorthand; field and operand domains are validated at construction.
Trusted criteria data or a previously validated filter for the same entity.
A positive resource ceiling; byte, depth, node, list and string budgets validate independently.
Resolved constructor budgets; wire limits also cover the versioned envelope.
Validated portable predicate data; executable predicates are prepared separately.
Functions
Decodes bounded JSON, rejecting duplicate object keys and trailing data.
Decodes a whitelisted versioned map; raw JSON must use from_json to retain duplicate keys.
Normalizes criteria and validates field/operator/value domains before evaluation.
Constructs a filter or raises its structured validation error.
Prepares a local unary predicate after validating captured coverage, including empty domains.
Returns the explicit versioned string-keyed wire representation.
Types
Local map criteria or keyword shorthand; field and operand domains are validated at construction.
Trusted criteria data or a previously validated filter for the same entity.
@type limit_option() :: {:max_bytes, pos_integer()} | {:max_depth, pos_integer()} | {:max_nodes, pos_integer()} | {:max_list, pos_integer()} | {:max_string_bytes, pos_integer()}
A positive resource ceiling; byte, depth, node, list and string budgets validate independently.
@type limits() :: %{ max_bytes: pos_integer(), max_depth: pos_integer(), max_nodes: pos_integer(), max_list: pos_integer(), max_string_bytes: pos_integer() }
Resolved constructor budgets; wire limits also cover the versioned envelope.
@opaque t()
Validated portable predicate data; executable predicates are prepared separately.
Functions
@spec from_json(LibTmux.Schema.entity_selector(), binary(), [limit_option()]) :: {:ok, t()} | {:error, LibTmux.Error.t()}
Decodes bounded JSON, rejecting duplicate object keys and trailing data.
@spec from_wire(LibTmux.Schema.entity_selector(), term(), [limit_option()]) :: {:ok, t()} | {:error, LibTmux.Error.t()}
Decodes a whitelisted versioned map; raw JSON must use from_json to retain duplicate keys.
@spec new(LibTmux.Schema.entity_selector(), input(), [limit_option()]) :: {:ok, t()} | {:error, LibTmux.Error.t()}
Normalizes criteria and validates field/operator/value domains before evaluation.
An existing filter retains its constructor's validation when no new limits are supplied. Explicit limits check the normalized tree directly, without expanding it into synthetic input syntax.
@spec new!(LibTmux.Schema.entity_selector(), input(), [limit_option()]) :: t()
Constructs a filter or raises its structured validation error.
@spec to_predicate(t(), [{:snapshot, LibTmux.Snapshot.t()}]) :: (LibTmux.Schema.observation() -> boolean())
Prepares a local unary predicate after validating captured coverage, including empty domains.
@spec to_wire(t()) :: LibTmux.Wire.object()
Returns the explicit versioned string-keyed wire representation.