Struct wasmer_near::Exports [−][src]
pub struct Exports { /* fields omitted */ }
Expand description
Exports is a special kind of map that allows easily unwrapping the types of instances.
TODO: add examples of using exports
Implementations
Creates a new Exports
with capacity n
.
Insert a new export into this Exports
map.
Get an export given a name
.
The get
method is specifically made for usage inside of
Rust APIs, as we can detect what’s the desired type easily.
If you want to get an export dynamically with type checking
please use the following functions: get_func
, get_memory
,
get_table
or get_global
instead.
If you want to get an export dynamically handling manually
type checking manually, please use get_extern
.
Get an export as a Global
.
Get an export as a Memory
.
Get an export as a Func
.
pub fn get_native_function<Args, Rets>(
&self,
name: &str
) -> Result<NativeFunc<Args, Rets>, ExportError> where
Args: WasmTypeList,
Rets: WasmTypeList,
pub fn get_native_function<Args, Rets>(
&self,
name: &str
) -> Result<NativeFunc<Args, Rets>, ExportError> where
Args: WasmTypeList,
Rets: WasmTypeList,
Get an export as a NativeFunc
.
pub fn get_with_generics<'a, T, Args, Rets>(
&'a self,
name: &str
) -> Result<T, ExportError> where
Args: WasmTypeList,
Rets: WasmTypeList,
T: ExportableWithGenerics<'a, Args, Rets>,
pub fn get_with_generics<'a, T, Args, Rets>(
&'a self,
name: &str
) -> Result<T, ExportError> where
Args: WasmTypeList,
Rets: WasmTypeList,
T: ExportableWithGenerics<'a, Args, Rets>,
Hack to get this working with nativefunc too
pub fn get_with_generics_weak<'a, T, Args, Rets>(
&'a self,
name: &str
) -> Result<T, ExportError> where
Args: WasmTypeList,
Rets: WasmTypeList,
T: ExportableWithGenerics<'a, Args, Rets>,
pub fn get_with_generics_weak<'a, T, Args, Rets>(
&'a self,
name: &str
) -> Result<T, ExportError> where
Args: WasmTypeList,
Rets: WasmTypeList,
T: ExportableWithGenerics<'a, Args, Rets>,
Like get_with_generics
but with a WeakReference to the InstanceRef
internally.
This is useful for passing data into WasmerEnv
, for example.
Get an export as an Extern
.
Returns true if the Exports
contains the given export name.
Get an iterator over the exports.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Exports
impl !UnwindSafe for Exports
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Mutably borrows from an owned value. Read more