pub struct EvalWorkspace { /* private fields */ }Expand description
Reusable workspace for expression evaluation.
Using a workspace avoids heap allocations on every evaluate() call,
which is critical for performance in hot loops (generation, Newton-Raphson).
§Example
use ries_rs::eval::{EvalWorkspace, evaluate_with_workspace};
use ries_rs::expr::Expression;
let mut workspace = EvalWorkspace::new();
let expressions: Vec<Expression> = vec![];
let x = 1.0_f64;
for expr in &expressions {
let result = evaluate_with_workspace(expr, x, &mut workspace)?;
// workspace is reused, no new allocations
}Implementations§
Source§impl EvalWorkspace
impl EvalWorkspace
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EvalWorkspace
impl RefUnwindSafe for EvalWorkspace
impl Send for EvalWorkspace
impl Sync for EvalWorkspace
impl Unpin for EvalWorkspace
impl UnsafeUnpin for EvalWorkspace
impl UnwindSafe for EvalWorkspace
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more