Method
func_new_async
(&mut self, name: &str, func: F)
Source from the content-addressed store, hash-verified
| 717 | /// For documentation on blocking behavior see [`Self::func_wrap_async`]. |
| 718 | #[cfg(feature = "async")] |
| 719 | pub fn func_new_async<F>(&mut self, name: &str, func: F) -> Result<()> |
| 720 | where |
| 721 | F: for<'a> Fn( |
| 722 | StoreContextMut<'a, T>, |
| 723 | types::ComponentFunc, |
| 724 | &'a [Val], |
| 725 | &'a mut [Val], |
| 726 | ) -> Box<dyn Future<Output = Result<()>> + Send + 'a> |
| 727 | + Send |
| 728 | + Sync |
| 729 | + 'static, |
| 730 | { |
| 731 | self.insert(name, Definition::Func(HostFunc::func_new_async(func)?))?; |
| 732 | Ok(()) |
| 733 | } |
| 734 | |
| 735 | /// Define a new host-provided async function using dynamic types. |
| 736 | /// |
Callers
nothing calls this directly
Tested by
no test coverage detected