pub struct InitContext<'a, T, U: Factor> { /* private fields */ }
Expand description
An InitContext is passed to Factor::init
, giving access to the global
common wasmtime::component::Linker
.
Implementations§
Source§impl<'a, T, U: Factor> InitContext<'a, T, U>
impl<'a, T, U: Factor> InitContext<'a, T, U>
Sourcepub fn linker(&mut self) -> &mut Linker<T>
pub fn linker(&mut self) -> &mut Linker<T>
Returns a mutable reference to the wasmtime::component::Linker
.
Sourcepub fn get_data_fn(&self) -> fn(_: &mut T) -> &mut FactorInstanceState<U>
pub fn get_data_fn(&self) -> fn(_: &mut T) -> &mut FactorInstanceState<U>
Returns a function that can be used to get the instance state for this factor.
Sourcepub fn get_data_with_table_fn(
&self,
) -> fn(_: &mut T) -> (&mut FactorInstanceState<U>, &mut ResourceTable)
pub fn get_data_with_table_fn( &self, ) -> fn(_: &mut T) -> (&mut FactorInstanceState<U>, &mut ResourceTable)
Returns a function that can be used to get the instance state for this
factor along with the instance’s ResourceTable
.
Auto Trait Implementations§
impl<'a, T, U> Freeze for InitContext<'a, T, U>
impl<'a, T, U> !RefUnwindSafe for InitContext<'a, T, U>
impl<'a, T, U> Send for InitContext<'a, T, U>
impl<'a, T, U> Sync for InitContext<'a, T, U>
impl<'a, T, U> Unpin for InitContext<'a, T, U>
impl<'a, T, U> !UnwindSafe for InitContext<'a, T, U>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more