Struct wasmtime_runtime::GcRootsList
source · pub struct GcRootsList(/* private fields */);
Expand description
A list of GC roots.
This is effectively a builder for a GcRootsIter
that will be given to a GC
heap when it is time to perform garbage collection.
Implementations§
source§impl GcRootsList
impl GcRootsList
sourcepub unsafe fn add_wasm_stack_root(&mut self, ptr_to_root: SendSyncPtr<u64>)
pub unsafe fn add_wasm_stack_root(&mut self, ptr_to_root: SendSyncPtr<u64>)
Add a GC root that is inside a Wasm stack frame to this list.
sourcepub unsafe fn add_root(&mut self, ptr_to_root: SendSyncPtr<VMGcRef>)
pub unsafe fn add_root(&mut self, ptr_to_root: SendSyncPtr<VMGcRef>)
Add a GC root to this list.
sourcepub unsafe fn iter<'a>(&'a mut self) -> GcRootsIter<'a> ⓘ
pub unsafe fn iter<'a>(&'a mut self) -> GcRootsIter<'a> ⓘ
Get an iterator over all roots in this list.
§Safety
Callers must ensure that all the pointers to GC roots that have been
added to this list are valid for the duration of the 'a
lifetime.
Trait Implementations§
source§impl Default for GcRootsList
impl Default for GcRootsList
source§fn default() -> GcRootsList
fn default() -> GcRootsList
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GcRootsList
impl RefUnwindSafe for GcRootsList
impl Send for GcRootsList
impl Sync for GcRootsList
impl Unpin for GcRootsList
impl UnwindSafe for GcRootsList
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