MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / module

Method module

crates/wasmtime/src/runtime/component/linker.rs:774–777  ·  view source on GitHub ↗

Defines a [`Module`] within this instance. This can be used to provide a core wasm [`Module`] as an import to a component. The [`Module`] provided is saved within the linker for the specified `name` in this instance. # Errors This function will return an [`OutOfMemory`][crate::OutOfMemory] error when memory allocation fails. See the `OutOfMemory` type's documentation for details on Wasmtime's o

(&mut self, name: &str, module: &Module)

Source from the content-addressed store, hash-verified

772 /// memory allocation fails. See the `OutOfMemory` type's documentation for
773 /// details on Wasmtime's out-of-memory handling.
774 pub fn module(&mut self, name: &str, module: &Module) -> Result<()> {
775 self.insert(name, Definition::Module(module.clone()))?;
776 Ok(())
777 }
778
779 /// Defines a new resource of a given [`ResourceType`] in this linker.
780 ///

Callers 2

runMethod · 0.45
build_importsMethod · 0.45

Calls 4

OkFunction · 0.85
ModuleClass · 0.70
insertMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected