pub struct Limits {
pub memory_bytes: usize,
pub stack_bytes: usize,
pub load_budget: Duration,
pub call_budget: Duration,
pub max_op_values: usize,
pub max_canvas_ops: usize,
pub max_nodes: usize,
}Expand description
Resource limits of one VM.
Fields§
§memory_bytes: usizeQuickJS heap, in bytes (0: no limit). Running out stops the VM.
stack_bytes: usizeInterpreter stack, in bytes: deep recursion becomes a RangeError
rather than a native stack overflow. Must stay below the engine
thread’s stack.
load_budget: DurationEvaluating the bundle.
call_budget: DurationAny other call into JS: one event (with the rendering it causes), one list bind, one timer, one frame’s callbacks, the microtask drain.
max_op_values: usizeChanges JS may make at once (the op queue’s length): they are held in Rust memory, which the heap limit does not cover.
max_canvas_ops: usizeOperations one canvas drawing may record.
max_nodes: usizeNodes the core keeps (each may have a native view, whose memory the heap limit does not cover either).
Trait Implementations§
impl Copy for Limits
impl StructuralPartialEq for Limits
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnsafeUnpin for Limits
impl UnwindSafe for Limits
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