pub struct Runtime { /* private fields */ }Expand description
A JavaScript runtime: one heap, one memory limit, one set of host hooks.
Mirrors the role of JSRuntime in the QuickJS C API.
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn set_memory_limit(&mut self, limit: Option<usize>)
pub fn set_memory_limit(&mut self, limit: Option<usize>)
Equivalent of JS_SetMemoryLimit.
Sourcepub fn memory_limit(&self) -> Option<usize>
pub fn memory_limit(&self) -> Option<usize>
Configured memory limit, if any.
Sourcepub fn set_stack_size(&mut self, limit: Option<usize>)
pub fn set_stack_size(&mut self, limit: Option<usize>)
Equivalent of JS_SetMaxStackSize.
Sourcepub fn stack_size(&self) -> Option<usize>
pub fn stack_size(&self) -> Option<usize>
Configured stack size limit, if any.
Sourcepub fn run_gc(&self) -> CollectStats
pub fn run_gc(&self) -> CollectStats
Equivalent of JS_RunGC.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Runtime
impl !RefUnwindSafe for Runtime
impl !Send for Runtime
impl !Sync for Runtime
impl !UnwindSafe for Runtime
impl Forget for Runtime
impl Move for Runtime
impl Unpin for Runtime
impl UnsafeUnpin for Runtime
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