pub struct Expr { /* private fields */ }Expand description
A compiled expression.
Compiling is the only step that reads the source; evaluation is a walk over
the compiled nodes, so a host that evaluates the same expression per task —
a step condition, a parameter filled per process — compiles it once and
keeps the Expr.
Implementations§
Source§impl Expr
impl Expr
Sourcepub fn compile(source: &str) -> Result<Expr>
pub fn compile(source: &str) -> Result<Expr>
Compile source, or return the byte offset the parse stopped at.
Sourcepub fn references(&self) -> Vec<&str>
pub fn references(&self) -> Vec<&str>
The names this expression reads, deduplicated and sorted: variables, called functions, and the names of called methods (which a receiver may answer itself before the context is consulted).
A host that injects on demand — rather than filling a context with everything an expression might read — injects exactly these.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
How many nodes the compiled expression holds, for a host that bounds what it accepts.
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Forget for Expr
impl Freeze for Expr
impl Move 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