Expand description
Expressions: the JSONLogic surface a definition is written in.
Structs§
- Compile
Cx - 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 byExprEngine::compile. - Expr
Engine - Compiles and evaluates the JSONLogic a definition is written in.
- Expr
Engine Builder - Builds an
ExprEngine. - Field
Spec - One field of a config.
- Interpolated
- A document of
varholes in otherwise literal data,$keys kept verbatim. It is for payloads such as a MongoDB filter, where$oidis 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 asusize, up toMAX_ARRAY_INDEX; a larger number is a key), resolved at parse. - Rendered
- An
Interpolateddocument 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§
- Field
Kind - What a config field is, for tooling.
- Operator
Family - The family an operator belongs to.
- Root
- One of the three context roots a path starts at.
- Value
Kind - 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.4294967295and have a write allocate for every slot before it, which overflows on wasm32 and exhausts memory anywhere.
Traits§
- Config
Field - A type a config is made of.
- Eval
Root - A root
ExprEngine::evalevaluates against: an object holding the three context roots, as anOwnedDataValueor as aserde_json::Value. - Expr
Visitor - Receives every expression of a config, with its path.
- From
Value - A type an expression can resolve to.
- Resolve
Expr - The object-safe face of an
Expr, which aResolverevaluates: its logic, and its type’s conversion to an owned value (u64,i64andf64as numbers,boolas a boolean,Stringas a string,Pathas its dotted text, andOwnedDataValueas 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
ConfigFieldcalls it fromConfigField::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 (Nonewhen the name is computed) and where the reference sits. Lazy, so a caller that only asks whether one exists (vianext()) stops at the first.