pub struct CompiledExpr<K = String> { /* private fields */ }Expand description
A compiled, executable expression that owns its variable map.
Created by Tabula::compile.
Evaluation requires passing a slice of f64 values.
Implementations§
Source§impl<K> CompiledExpr<K>
impl<K> CompiledExpr<K>
Sourcepub fn vars(&self) -> &[K]
pub fn vars(&self) -> &[K]
Returns a slice of variable keys in the order they must be supplied for evaluation.
Sourcepub fn eval(&self, values: &[f64]) -> Result<f64, JitError>
pub fn eval(&self, values: &[f64]) -> Result<f64, JitError>
Evaluates the compiled expression with the given values.
The values slice must provide f64 values in the exact order specified by vars().
§Errors
JitError::ValuesLenifvalues.len()is less thanself.vars().len().JitError::Invalidatedif the expression was invalidated byTabula::free_memory.
Auto Trait Implementations§
impl<K> Freeze for CompiledExpr<K>
impl<K> RefUnwindSafe for CompiledExpr<K>where
K: RefUnwindSafe,
impl<K> Send for CompiledExpr<K>where
K: Send,
impl<K> Sync for CompiledExpr<K>where
K: Sync,
impl<K> Unpin for CompiledExpr<K>where
K: Unpin,
impl<K> UnwindSafe for CompiledExpr<K>where
K: UnwindSafe,
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