Convenience: trigger a hook event and collect successful outputs. Errors from individual hooks are logged but do not propagate.
(context: HookContext)
| 314 | /// Convenience: trigger a hook event and collect successful outputs. |
| 315 | /// Errors from individual hooks are logged but do not propagate. |
| 316 | pub async fn trigger_collect(context: HookContext) -> Vec<HookOutput> { |
| 317 | let system = global(); |
| 318 | let results = system.trigger(context).await; |
| 319 | let mut outputs = Vec::new(); |
| 320 | for result in results { |
| 321 | match result { |
| 322 | Ok(output) => outputs.push(output), |
| 323 | Err(e) => tracing::warn!("Plugin hook error: {}", e), |
| 324 | } |
| 325 | } |
| 326 | outputs |
| 327 | } |
| 328 | |
| 329 | /// Convenience: build a HookContext and trigger it on the global system. |
| 330 | pub async fn trigger_event(event: HookEvent) { |
no test coverage detected