Struct tinywasm::ModuleInstance
source · pub struct ModuleInstance(/* private fields */);Expand description
A WebAssembly Module Instance
Addrs are indices into the store’s data structures.
See https://webassembly.github.io/spec/core/exec/runtime.html#module-instances
Implementations§
source§impl ModuleInstance
impl ModuleInstance
sourcepub fn exports(&self) -> &ExportInstance
pub fn exports(&self) -> &ExportInstance
Get the module’s exports
sourcepub fn get_func(&self, store: &Store, name: &str) -> Result<FuncHandle>
pub fn get_func(&self, store: &Store, name: &str) -> Result<FuncHandle>
Get an exported function by name
sourcepub fn get_typed_func<P, R>(
&self,
store: &Store,
name: &str
) -> Result<TypedFuncHandle<P, R>>where
P: IntoWasmValueTuple,
R: FromWasmValueTuple,
pub fn get_typed_func<P, R>(
&self,
store: &Store,
name: &str
) -> Result<TypedFuncHandle<P, R>>where
P: IntoWasmValueTuple,
R: FromWasmValueTuple,
Get a typed exported function by name
sourcepub fn get_start_func(&mut self, store: &Store) -> Result<Option<FuncHandle>>
pub fn get_start_func(&mut self, store: &Store) -> Result<Option<FuncHandle>>
Get the start function of the module
Returns None if the module has no start function If no start function is specified, also checks for a _start function in the exports (which is not part of the spec, but used by llvm)
See https://webassembly.github.io/spec/core/syntax/modules.html#start-function
Trait Implementations§
source§impl Clone for ModuleInstance
impl Clone for ModuleInstance
source§fn clone(&self) -> ModuleInstance
fn clone(&self) -> ModuleInstance
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl RefUnwindSafe for ModuleInstance
impl Send for ModuleInstance
impl Sync for ModuleInstance
impl Unpin for ModuleInstance
impl UnwindSafe for ModuleInstance
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