Skip to main content

Module expression

Module expression 

Source
Expand description

A parsed, type-checked expression (Expr) and its evaluation.

An Expr is a closed tree with a fixed set of node kinds. The parser fixes every node’s type, so evaluation is typed: a number-typed node evaluates to an f64 with Expr::eval_num, a filter to a bool with Expr::eval_bool, and so on, without building a Value per node or checking again what the parser proved. Expr::evaluate gives any node’s result as a Value, for callers whose type is only known at run time.

Structs§

Dependency
The inputs an expression depends on, as a bit set.
EvaluationContext
The inputs an expression is evaluated with.
EvaluationError
Why an expression failed to evaluate. One pointer wide, so that a typed result such as Result<f64, EvaluationError> fits in two registers.
Expr
A parsed, type-checked expression.

Functions§

collect_global_state_refs
Collect the names of the global-state properties referenced by “global-state” expressions in the given expression tree.
evaluate_accumulated
evaluate_feature_with_context
Evaluates e against a GeoJSON feature and every other input of params, whose own feature is ignored. When params names a canonical tile, the feature’s geometry is placed in that tile, as the within and distance expressions need.
global_state_refs_intersect
Whether any of the global-state keys referenced by an expression is among the changed keys. A null set on either side means “unknown” and is conservatively treated as a match.
with_geojson_feature
Calls f with params and a view of feature as its feature, placed in params’ canonical tile when it names one.

Type Aliases§

EvalResult
The result of a typed evaluation.
EvaluationResult
FeatureState
GlobalStateMap