(&mut self, call_hook: &mut CallHookInner<T>, s: CallHook)
| 1439 | } |
| 1440 | |
| 1441 | fn invoke_call_hook(&mut self, call_hook: &mut CallHookInner<T>, s: CallHook) -> Result<()> { |
| 1442 | match call_hook { |
| 1443 | #[cfg(feature = "call-hook")] |
| 1444 | CallHookInner::Sync(hook) => hook((&mut *self).as_context_mut(), s), |
| 1445 | |
| 1446 | #[cfg(all(feature = "async", feature = "call-hook"))] |
| 1447 | CallHookInner::Async(handler) => { |
| 1448 | if !self.can_block() { |
| 1449 | bail!("couldn't grab async_cx for call hook") |
| 1450 | } |
| 1451 | return (&mut *self) |
| 1452 | .as_context_mut() |
| 1453 | .with_blocking(|store, cx| cx.block_on(handler.handle_call_event(store, s)))?; |
| 1454 | } |
| 1455 | |
| 1456 | CallHookInner::ForceTypeParameterToBeUsed { uninhabited, .. } => { |
| 1457 | let _ = s; |
| 1458 | match *uninhabited {} |
| 1459 | } |
| 1460 | } |
| 1461 | } |
| 1462 | |
| 1463 | #[cfg(not(feature = "async"))] |
| 1464 | fn flush_fiber_stack(&mut self) { |
no test coverage detected