pub struct Engine { /* private fields */ }Expand description
A Fusabi execution engine.
The engine provides a sandboxed environment for executing Fusabi scripts with configurable limits and capabilities.
Implementations§
Source§impl Engine
impl Engine
Sourcepub fn new(config: EngineConfig) -> Result<Self>
pub fn new(config: EngineConfig) -> Result<Self>
Create a new engine with the given configuration.
Sourcepub fn config(&self) -> &EngineConfig
pub fn config(&self) -> &EngineConfig
Get the engine configuration.
Sourcepub fn registry_mut(&mut self) -> &mut HostRegistry
pub fn registry_mut(&mut self) -> &mut HostRegistry
Get mutable access to the host registry.
Sourcepub fn registry(&self) -> &HostRegistry
pub fn registry(&self) -> &HostRegistry
Get the host registry.
Sourcepub fn context(&self) -> &ExecutionContext
pub fn context(&self) -> &ExecutionContext
Get the execution context.
Sourcepub fn execute(&self, source: &str) -> Result<Value>
pub fn execute(&self, source: &str) -> Result<Value>
Execute a source string and return the result.
Sourcepub fn execute_bytecode(&self, bytecode: &[u8]) -> Result<Value>
pub fn execute_bytecode(&self, bytecode: &[u8]) -> Result<Value>
Execute compiled bytecode.
Sourcepub fn is_healthy(&self) -> bool
pub fn is_healthy(&self) -> bool
Check if the engine is healthy.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Engine
impl !RefUnwindSafe for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl !UnwindSafe for Engine
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