pub struct PersistentSandbox { /* private fields */ }Expand description
Reusable sandbox wrapper that keeps a loaded script set and re-executes it with appended probe code.
This preserves the public API expected by Soleno and jsdet consumers while keeping the execution model explicit and deterministic.
Implementations§
Source§impl PersistentSandbox
impl PersistentSandbox
Sourcepub fn new(
module: &CompiledModule,
bridge: Arc<dyn Bridge>,
config: &SandboxConfig,
) -> Result<Self>
pub fn new( module: &CompiledModule, bridge: Arc<dyn Bridge>, config: &SandboxConfig, ) -> Result<Self>
Create a new reusable sandbox.
Sourcepub fn load(&mut self, scripts: &[String]) -> Result<()>
pub fn load(&mut self, scripts: &[String]) -> Result<()>
Load the baseline scripts that should run before every probe.
Sourcepub fn eval_only(&mut self, script: &str) -> Vec<Observation>
pub fn eval_only(&mut self, script: &str) -> Vec<Observation>
Execute probe code against the currently loaded script set.
Sourcepub fn store_fuel(&self) -> Result<u64>
pub fn store_fuel(&self) -> Result<u64>
Return the currently configured store fuel.
Sourcepub fn set_store_fuel(&mut self, fuel: u64)
pub fn set_store_fuel(&mut self, fuel: u64)
Update the configured store fuel for future executions.
Auto Trait Implementations§
impl Freeze for PersistentSandbox
impl !RefUnwindSafe for PersistentSandbox
impl Send for PersistentSandbox
impl Sync for PersistentSandbox
impl Unpin for PersistentSandbox
impl UnsafeUnpin for PersistentSandbox
impl !UnwindSafe for PersistentSandbox
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