Struct wasmer_runtime_core_x::Module
source · pub struct Module { /* private fields */ }
Expand description
A compiled WebAssembly module.
Module
is returned by the compile_with
function.
Implementations§
source§impl Module
impl Module
sourcepub fn instantiate(&self, import_object: &ImportObject) -> Result<Instance>
pub fn instantiate(&self, import_object: &ImportObject) -> Result<Instance>
Instantiate a WebAssembly module with the provided ImportObject
.
§Note:
Instantiating a Module
will also call the function designated as start
in the WebAssembly module, if there is one.
§Usage:
let import_object = imports! {
// ...
};
let instance = module.instantiate(&import_object)?;
// ...
sourcepub fn cache(&self) -> Result<Artifact, CacheError>
pub fn cache(&self) -> Result<Artifact, CacheError>
Create a cache artifact from this module.
sourcepub fn info(&self) -> &ModuleInfo
pub fn info(&self) -> &ModuleInfo
Get the module data for this module.
sourcepub fn exports(&self) -> Vec<ExportDescriptor<'_>>
pub fn exports(&self) -> Vec<ExportDescriptor<'_>>
Get the ExportDescriptor
s of the exports this Module
provides.
sourcepub fn imports(&self) -> Vec<ImportDescriptor>
pub fn imports(&self) -> Vec<ImportDescriptor>
Get the ImportDescriptor
s describing the imports this Module
requires to be instantiated.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Module
impl !RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl !UnwindSafe for Module
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