pub struct ExportInstance<'a, 'store> { /* private fields */ }
Available on crate features
runtime
and component-model
only.Expand description
Description of the exports of a single instance.
This structure is created from Exports
via the Exports::root
or
Exports::instance
methods. This type provides access to the first layer
of exports within an instance. The ExportInstance::instance
method
can be used to provide nested access to sub-instances.
Implementations§
Source§impl<'a, 'store> ExportInstance<'a, 'store>
impl<'a, 'store> ExportInstance<'a, 'store>
Sourcepub fn typed_func<Params, Results>(
&mut self,
name: &str,
) -> Result<TypedFunc<Params, Results>>
pub fn typed_func<Params, Results>( &mut self, name: &str, ) -> Result<TypedFunc<Params, Results>>
Same as Instance::get_typed_func
Sourcepub fn resource(&mut self, name: &str) -> Option<ResourceType>
pub fn resource(&mut self, name: &str) -> Option<ResourceType>
Same as Instance::get_resource
Sourcepub fn modules(&self) -> impl Iterator<Item = (&'a str, &'a Module)> + '_
pub fn modules(&self) -> impl Iterator<Item = (&'a str, &'a Module)> + '_
Returns an iterator of all of the exported modules that this instance contains.
Sourcepub fn instance(&mut self, name: &str) -> Option<ExportInstance<'a, '_>>
pub fn instance(&mut self, name: &str) -> Option<ExportInstance<'a, '_>>
Looks up the exported instance with the name
specified and returns
a description of its exports.
Sourcepub fn into_instance(self, name: &str) -> Option<ExportInstance<'a, 'store>>
pub fn into_instance(self, name: &str) -> Option<ExportInstance<'a, 'store>>
Same as ExportInstance::instance
but consumes self to yield a
return value with the same lifetimes.
Auto Trait Implementations§
impl<'a, 'store> Freeze for ExportInstance<'a, 'store>
impl<'a, 'store> !RefUnwindSafe for ExportInstance<'a, 'store>
impl<'a, 'store> Send for ExportInstance<'a, 'store>
impl<'a, 'store> Sync for ExportInstance<'a, 'store>
impl<'a, 'store> Unpin for ExportInstance<'a, 'store>
impl<'a, 'store> !UnwindSafe for ExportInstance<'a, 'store>
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> 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