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.
- Evaluation
Context - The inputs an expression is evaluated with.
- Evaluation
Error - 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
eagainst a GeoJSON feature and every other input ofparams, whose own feature is ignored. Whenparamsnames 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
fwithparamsand a view offeatureas its feature, placed inparams’ canonical tile when it names one.
Type Aliases§
- Eval
Result - The result of a typed evaluation.
- Evaluation
Result - Feature
State - Global
State Map