pub struct Reference { /* private fields */ }Expand description
A parsed reference into a routed value: a dot-separated path with array
indexing, the same path grammar the expression language uses for an
operand, standing alone as a value reference rather than inside a boolean.
This is how a map node’s over field names the list it fans out over: the
reference is resolved against the node’s routed value at fan-out time, and the
engine reuses the identical missing-path semantics the branch expressions use,
so references resolve one consistent way across the whole document. It owns
its whole path, borrows nothing, and holds no IO, clock, or randomness, so it
is safe to keep and re-resolve for the life of a run.
Implementations§
Source§impl Reference
impl Reference
Sourcepub fn resolve<'a>(&self, value: &'a Value) -> Option<&'a Value>
pub fn resolve<'a>(&self, value: &'a Value) -> Option<&'a Value>
Resolves the reference against a routed value, returning the value it
names or None when the path is missing (an absent key, an index past the
end, or a descent into a non-container).
This is TOTAL: it never panics for any value, and its missing-path
semantics are exactly those Expr::eval uses for a path operand.