Skip to main content

Module expr

Module expr 

Source
Expand description

Expressions: the JSONLogic surface a definition is written in.

Structs§

CompileCx
Compiles config fields, recording each issue at its exact authored path.
Evaluated
What an evaluation returns: the value and what it cost.
Expr
Compiled JSONLogic resolving to a T, made by ExprEngine::compile.
ExprEngine
Compiles and evaluates the JSONLogic a definition is written in.
ExprEngineBuilder
Builds an ExprEngine.
FieldSpec
One field of a config.
Interpolated
A document of var holes in otherwise literal data, $ keys kept verbatim. It is for payloads such as a MongoDB filter, where $oid is data and {"var": ...} is the only live part.
Operator
One operator an engine can evaluate.
Output
A write destination: an Expr<Path>, folded when literal.
Path
A root plus typed segments, parsed once. A segment is a key on an object (one leading # stripped) and an index on an array (the raw segment parsed as usize, up to MAX_ARRAY_INDEX; a larger number is a key), resolved at parse.
Rendered
An Interpolated document with its holes resolved, borrowed from the compiled document and the context the call sees.
Secrets
An engine-scoped store of values readable through {"secret": "name"}.
Visit
A walk over a compiled config’s expressions.

Enums§

FieldKind
What a config field is, for tooling.
OperatorFamily
The family an operator belongs to.
Root
One of the three context roots a path starts at.
ValueKind
What a field’s value is, for a field’s schema and for checking a literal.

Constants§

MAX_ARRAY_INDEX
The largest index a bare numeric segment names on an array. A larger number is a key, so no path can make a write pad an array past it: a trace read from outside the engine, or a computed path, could otherwise name data.list.4294967295 and have a write allocate for every slot before it, which overflows on wasm32 and exhausts memory anywhere.

Traits§

ConfigField
A type a config is made of.
EvalRoot
A root ExprEngine::eval evaluates against: an object holding the three context roots, as an OwnedDataValue or as a serde_json::Value.
ExprVisitor
Receives every expression of a config, with its path.
FromValue
A type an expression can resolve to.
ResolveExpr
The object-safe face of an Expr, which a Resolver evaluates: its logic, and its type’s conversion to an owned value (u64, i64 and f64 as numbers, bool as a boolean, String as a string, Path as its dotted text, and OwnedDataValue as itself).
Resolver
What resolving a config needs from a call: an expression evaluated, and a document rendered, each to an owned value, against the context the call sees. A ConfigField calls it from ConfigField::resolve; a call’s context implements it (Ctx, through a shared reference).

Functions§

escaped_keys
Every object key that starts with exactly one $, at any depth.
secret_refs
Every {"secret": …} reference, as the literal name (None when the name is computed) and where the reference sits. Lazy, so a caller that only asks whether one exists (via next()) stops at the first.