MCPcopy Create free account
hub / github.com/AI45Lab/Code / matching_hooks

Method matching_hooks

core/src/hooks/engine.rs:276–287  ·  view source on GitHub ↗

Get all hooks matching an event (sorted by priority)

(&self, event: &HookEvent)

Source from the content-addressed store, hash-verified

274
275 /// Get all hooks matching an event (sorted by priority)
276 pub fn matching_hooks(&self, event: &HookEvent) -> Vec<Hook> {
277 let hooks = read_or_recover(&self.hooks);
278 let mut matching: Vec<Hook> = hooks
279 .values()
280 .filter(|h| h.matches(event))
281 .cloned()
282 .collect();
283
284 // Sort by priority (lower values = higher priority)
285 matching.sort_by_key(|h| h.config.priority);
286 matching
287 }
288
289 /// Fire an event and get the result
290 pub async fn fire(&self, event: &HookEvent) -> HookResult {

Callers 2

fireMethod · 0.80

Calls 2

read_or_recoverFunction · 0.85
matchesMethod · 0.45

Tested by 1