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

source

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.

source

pub unsafe fn add_root(&mut self, ptr_to_root: SendSyncPtr<VMGcRef>)

Add a GC root to this list.

source

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.

source

pub fn is_empty(&self) -> bool

Is this list empty?

source

pub fn clear(&mut self)

Clear this GC roots list.

Trait Implementations§

source§

impl Default for GcRootsList

source§

fn default() -> GcRootsList

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.