Define a host function within this linker. For information about how the host function operates, see [`Func::wrap`]. That includes information about translating Rust types to WebAssembly native types. This method creates a host-provided function in this linker under the provided name. This method is distinct in its capability to create a [`Store`](crate::Store)-independent function. This means t
(
&mut self,
module: &str,
name: &str,
func: impl IntoFunc<T, Params, Args>,
)
| 558 | /// memory allocation fails. See the `OutOfMemory` type's documentation for |
| 559 | /// details on Wasmtime's out-of-memory handling. |
| 560 | pub fn func_wrap<Params, Args>( |
| 561 | &mut self, |
| 562 | module: &str, |
| 563 | name: &str, |
| 564 | func: impl IntoFunc<T, Params, Args>, |
| 565 | ) -> Result<&mut Self> |
| 566 | where |
| 567 | T: 'static, |
| 568 | { |
| 569 | self.func_insert(module, name, func.into_func(&self.engine)?) |
| 570 | } |
| 571 | |
| 572 | /// Asynchronous analog of [`Linker::func_wrap`]. |
| 573 | #[cfg(feature = "async")] |