Same as [`Linker::define`], except only the name of the import is provided, not a module name as well. This is only relevant when working with the module linking proposal where one-level names are allowed (in addition to two-level names). Otherwise this method need not be used. # Errors This function will return an [`OutOfMemory`][crate::OutOfMemory] error when memory allocation fails. See the
(
&mut self,
store: impl AsContext<Data = T>,
name: &str,
item: impl Into<Extern>,
)
| 388 | /// memory allocation fails. See the `OutOfMemory` type's documentation for |
| 389 | /// details on Wasmtime's out-of-memory handling. |
| 390 | pub fn define_name( |
| 391 | &mut self, |
| 392 | store: impl AsContext<Data = T>, |
| 393 | name: &str, |
| 394 | item: impl Into<Extern>, |
| 395 | ) -> Result<&mut Self> |
| 396 | where |
| 397 | T: 'static, |
| 398 | { |
| 399 | let store = store.as_context(); |
| 400 | let key = self.import_key(name, None)?; |
| 401 | self.insert(key, Definition::new(store.0, item.into()))?; |
| 402 | Ok(self) |
| 403 | } |
| 404 | |
| 405 | fn func_insert(&mut self, module: &str, name: &str, func: HostFunc) -> Result<&mut Self> |
| 406 | where |