| 61 | } |
| 62 | |
| 63 | async fn call< |
| 64 | P: ComponentNamedList + Lower + 'static, |
| 65 | R: ComponentNamedList + Lift + 'static, |
| 66 | T: Send, |
| 67 | >( |
| 68 | self, |
| 69 | store: &mut Store<T>, |
| 70 | func: TypedFunc<P, R>, |
| 71 | params: P, |
| 72 | ) -> Result<R> { |
| 73 | match self { |
| 74 | ApiStyle::Sync => func.call(&mut *store, params), |
| 75 | ApiStyle::Async | ApiStyle::AsyncNotConcurrent => { |
| 76 | func.call_async(&mut *store, params).await |
| 77 | } |
| 78 | ApiStyle::Concurrent => Ok(store |
| 79 | .run_concurrent(async |access| func.call_concurrent(access, params).await) |
| 80 | .await??), |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | async fn resource_drop<T: Send>( |
| 85 | self, |