pub struct Expr { /* private fields */ }Expand description
A parsed, ready-to-evaluate condition expression.
Produced by parse and evaluated by Expr::eval. It owns its whole AST,
borrows nothing, and holds no IO, clock, or randomness, so it is safe to keep
and re-evaluate for the life of a run.
Implementations§
Source§impl Expr
impl Expr
Sourcepub fn eval(&self, value: &Value) -> bool
pub fn eval(&self, value: &Value) -> bool
Evaluates the expression against a routed value, always returning a
bool.
This is TOTAL: it never panics and never errors for any value. The
missing-path, type-mismatch, and number-comparison semantics are those
documented on the module. Eval is a single linear walk of the
AST, whose size is bounded by MAX_EXPRESSION_LEN.
Trait Implementations§
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more