pub struct Isolate<'arena> { /* private fields */ }
Expand description
Isolate is a component that encapsulates an isolated environment for executing expressions.
Rerunning the Isolate allows for efficient memory reuse through an arena allocator. The arena allocator optimizes memory management by reusing memory blocks for subsequent evaluations, contributing to improved performance and resource utilization in scenarios where the Isolate is reused multiple times.
Implementations§
Source§impl<'a> Isolate<'a>
impl<'a> Isolate<'a>
pub fn new() -> Self
pub fn with_environment(variable: Variable) -> Self
pub fn set_environment(&mut self, variable: Variable)
pub fn update_environment<F>(&mut self, updater: F)
pub fn set_reference(&mut self, reference: &'a str) -> Result<(), IsolateError>
pub fn get_reference(&self, reference: &str) -> Option<Variable>
pub fn clear_references(&mut self)
pub fn compile_standard( &mut self, source: &'a str, ) -> Result<Expression<Standard>, IsolateError>
pub fn run_standard( &mut self, source: &'a str, ) -> Result<Variable, IsolateError>
pub fn compile_unary( &mut self, source: &'a str, ) -> Result<Expression<Unary>, IsolateError>
pub fn run_unary(&mut self, source: &'a str) -> Result<bool, IsolateError>
Trait Implementations§
Auto Trait Implementations§
impl<'arena> Freeze for Isolate<'arena>
impl<'arena> !RefUnwindSafe for Isolate<'arena>
impl<'arena> !Send for Isolate<'arena>
impl<'arena> !Sync for Isolate<'arena>
impl<'arena> Unpin for Isolate<'arena>
impl<'arena> !UnwindSafe for Isolate<'arena>
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