pub struct Sandbox { /* private fields */ }Expand description
A live handle to a sandbox’s budget. The budget itself lives in the
runtime’s shared GlobalState, so it spans every thread (main and
coroutines); this handle just reads and resets it through the Lua.
Implementations§
Source§impl Sandbox
impl Sandbox
Sourcepub fn instructions_remaining(&self) -> Option<u64>
pub fn instructions_remaining(&self) -> Option<u64>
Instructions left before the budget trips, or None if no instruction
limit was configured.
Sourcepub fn instructions_used(&self) -> Option<u64>
pub fn instructions_used(&self) -> Option<u64>
Instructions consumed so far (rounded to the check interval), or None
if no instruction limit was configured.
Sourcepub fn tripped(&self) -> Option<TripReason>
pub fn tripped(&self) -> Option<TripReason>
Why the last run aborted, if it was the sandbox that stopped it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sandbox
impl !RefUnwindSafe for Sandbox
impl !Send for Sandbox
impl !Sync for Sandbox
impl Unpin for Sandbox
impl UnsafeUnpin for Sandbox
impl !UnwindSafe for Sandbox
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