(
&mut self,
module: &str,
name: &str,
ty: FuncType,
func: F,
)
| 477 | /// this linker. |
| 478 | #[cfg(feature = "async")] |
| 479 | pub fn func_new_async<F>( |
| 480 | &mut self, |
| 481 | module: &str, |
| 482 | name: &str, |
| 483 | ty: FuncType, |
| 484 | func: F, |
| 485 | ) -> Result<&mut Self> |
| 486 | where |
| 487 | F: for<'a> Fn( |
| 488 | Caller<'a, T>, |
| 489 | &'a [Val], |
| 490 | &'a mut [Val], |
| 491 | ) -> Box<dyn Future<Output = Result<()>> + Send + 'a> |
| 492 | + Send |
| 493 | + Sync |
| 494 | + 'static, |
| 495 | T: Send + 'static, |
| 496 | { |
| 497 | self.func_insert(module, name, HostFunc::new_async(&self.engine, ty, func)?) |
| 498 | } |
| 499 | |
| 500 | /// Define a host function within this linker. |
| 501 | /// |
no test coverage detected