| 512 | /// [`func_wrap_async`]: LinkerInstance::func_wrap_async |
| 513 | #[cfg(feature = "async")] |
| 514 | pub fn func_wrap_async<Params, Return, F>(&mut self, name: &str, f: F) -> Result<()> |
| 515 | where |
| 516 | F: Fn( |
| 517 | StoreContextMut<'_, T>, |
| 518 | Params, |
| 519 | ) -> Box<dyn Future<Output = Result<Return>> + Send + '_> |
| 520 | + Send |
| 521 | + Sync |
| 522 | + 'static, |
| 523 | Params: ComponentNamedList + Lift + 'static, |
| 524 | Return: ComponentNamedList + Lower + 'static, |
| 525 | { |
| 526 | self.insert(name, Definition::Func(HostFunc::func_wrap_async(f)?))?; |
| 527 | Ok(()) |
| 528 | } |
| 529 | |
| 530 | /// Defines a new host-provided async function into this [`LinkerInstance`]. |
| 531 | /// |