Convert HookResponse to HookResult
(&self, response: HookResponse)
| 375 | |
| 376 | /// Convert HookResponse to HookResult |
| 377 | fn response_to_result(&self, response: HookResponse) -> HookResult { |
| 378 | match response.action { |
| 379 | HookAction::Continue => HookResult::Continue(response.modified), |
| 380 | HookAction::Block => { |
| 381 | HookResult::Block(response.reason.unwrap_or_else(|| "Blocked".to_string())) |
| 382 | } |
| 383 | HookAction::Retry => HookResult::Retry(response.retry_delay_ms.unwrap_or(1000)), |
| 384 | HookAction::Skip => HookResult::Skip, |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | /// Get the number of registered hooks |
| 389 | pub fn hook_count(&self) -> usize { |