pub trait BuiltinResolver {
// Required methods
fn handles(&self, op: BuiltinOp) -> bool;
fn apply(
&self,
op: BuiltinOp,
args: &[Literal],
) -> Result<Literal, ExprError>;
}Expand description
A source of answers for builtins this evaluator cannot compute on its own.
The graph traversal builtins read an instance, which the pure evaluator does not hold. A resolver plugs that context in at every point a builtin is applied — not only at the root of the expression — so a graph builtin nested under a comparison, a binding, a lambda, or a comprehension answers exactly as it would at the top.
Required Methods§
Sourcefn handles(&self, op: BuiltinOp) -> bool
fn handles(&self, op: BuiltinOp) -> bool
Whether this resolver answers for op. Operations it declines are
computed by apply_builtin.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".