[−][src]Struct wasmer::Exports
Exports is a special kind of map that allows easily unwrapping the types of instances.
TODO: add examples of using exports
Implementations
impl Exports
[src]
pub fn new() -> Self
[src]
Creates a new Exports
.
pub fn with_capacity(n: usize) -> Self
[src]
Creates a new Exports
with capacity n
.
pub fn len(&self) -> usize
[src]
Return the number of exports in the Exports
map.
pub fn is_empty(&self) -> bool
[src]
Return whether or not there are no exports
pub fn insert<S, E>(&mut self, name: S, value: E) where
S: Into<String>,
E: Into<Extern>,
[src]
S: Into<String>,
E: Into<Extern>,
Insert a new export into this Exports
map.
pub fn get<'a, T: Exportable<'a>>(
&'a self,
name: &str
) -> Result<&'a T, ExportError>
[src]
&'a self,
name: &str
) -> Result<&'a T, ExportError>
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
.
pub fn get_global(&self, name: &str) -> Result<&Global, ExportError>
[src]
Get an export as a Global
.
pub fn get_memory(&self, name: &str) -> Result<&Memory, ExportError>
[src]
Get an export as a Memory
.
pub fn get_table(&self, name: &str) -> Result<&Table, ExportError>
[src]
Get an export as a Table
.
pub fn get_function(&self, name: &str) -> Result<&Function, ExportError>
[src]
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,
[src]
&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>,
[src]
&'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_extern(&self, name: &str) -> Option<&Extern>
[src]
Get an export as an Extern
.
pub fn contains<S>(&self, name: S) -> bool where
S: Into<String>,
[src]
S: Into<String>,
Returns true if the Exports
contains the given export name.
pub fn iter(
&self
) -> ExportsIterator<'_, impl Iterator<Item = (&String, &Extern)>>ⓘ
[src]
&self
) -> ExportsIterator<'_, impl Iterator<Item = (&String, &Extern)>>ⓘ
Get an iterator over the exports.
Trait Implementations
impl Clone for Exports
[src]
impl Debug for Exports
[src]
impl Default for Exports
[src]
impl FromIterator<(String, Extern)> for Exports
[src]
impl LikeNamespace for Exports
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Exports
[src]
impl Send for Exports
[src]
impl Sync for Exports
[src]
impl Unpin for Exports
[src]
impl !UnwindSafe for Exports
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,