pub struct Compiled { /* private fields */ }Expand description
A compiled expression: evaluates in about a hundred nanoseconds.
Implementations§
Source§impl Compiled
impl Compiled
Sourcepub fn new(src: &str, scope: &Scope<'_>) -> Result<Self, ExprError>
pub fn new(src: &str, scope: &Scope<'_>) -> Result<Self, ExprError>
Compiles src against scope. An expression that folds to a non-finite constant
(1/0, log(-1)) is an error.
pub fn source(&self) -> &str
Sourcepub fn eval(&self, frame: &Frame<'_>) -> f64
pub fn eval(&self, frame: &Frame<'_>) -> f64
The value on frame (may be non-finite: super::Track::eval checks).
Trait Implementations§
impl StructuralPartialEq for Compiled
Auto Trait Implementations§
impl Forget for Compiled
impl Freeze for Compiled
impl RefUnwindSafe for Compiled
impl Send for Compiled
impl Sync for Compiled
impl Unpin for Compiled
impl UnsafeUnpin for Compiled
impl UnwindSafe for Compiled
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