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)
| 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 | /// |