pub struct VmContextRegistryGuard { /* private fields */ }Expand description
RAII owner of the thread-local node:vm context registry for one session.
Mirrors the per-session ownership of PendingPromises (created fresh per
session, dropped at teardown): a session holds one guard, and dropping it
evicts every context slot the session reserved. Because Drop runs on every
termination path of the frame that holds the guard — normal return, ? error,
early return, and panic unwinding — the slots are reclaimed unconditionally,
not only on the happy path. This prevents a reused isolate thread from
accumulating vm.createContext() slots across executions toward
MAX_VM_CONTEXTS.
Implementations§
Trait Implementations§
Source§impl Default for VmContextRegistryGuard
impl Default for VmContextRegistryGuard
Source§impl Drop for VmContextRegistryGuard
impl Drop for VmContextRegistryGuard
Auto Trait Implementations§
impl Freeze for VmContextRegistryGuard
impl RefUnwindSafe for VmContextRegistryGuard
impl Send for VmContextRegistryGuard
impl Sync for VmContextRegistryGuard
impl Unpin for VmContextRegistryGuard
impl UnsafeUnpin for VmContextRegistryGuard
impl UnwindSafe for VmContextRegistryGuard
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