pub struct Isolate { /* 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 Isolate
impl Isolate
pub fn new() -> Self
pub fn with_environment(variable: Variable) -> Self
pub fn with_cache(self, cache: Option<Arc<OpcodeCache>>) -> Self
pub fn set_environment(&mut self, variable: Variable)
pub fn set_cache(&mut self, cache: Arc<OpcodeCache>)
pub fn scope(&self) -> &Scope
pub fn set_local(&mut self, name: Symbol, value: Variable)
pub fn insert_dollar(&mut self, path: &str, value: Variable)
pub fn set_reference(&mut self, reference: &str) -> Result<(), IsolateError>
pub fn set_reference_value( &mut self, value: Variable, ) -> Result<(), IsolateError>
pub fn get_reference(&self, reference: &str) -> Option<Variable>
pub fn compile_standard( &mut self, source: &str, ) -> Result<Expression<Standard>, IsolateError>
pub fn run_standard(&mut self, source: &str) -> Result<Variable, IsolateError>
pub fn run_compiled( &mut self, source: &[Opcode], ) -> Result<Variable, IsolateError>
pub fn compile_unary( &mut self, source: &str, ) -> Result<Expression<Unary>, IsolateError>
pub fn run_unary(&mut self, source: &str) -> Result<bool, IsolateError>
pub fn run_unary_compiled( &mut self, code: &[Opcode], ) -> Result<bool, IsolateError>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Isolate
impl !RefUnwindSafe for Isolate
impl !Send for Isolate
impl !Sync for Isolate
impl !UnwindSafe for Isolate
impl Unpin for Isolate
impl UnsafeUnpin for Isolate
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