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

Method matches

core/src/hooks/engine.rs:97–109  ·  view source on GitHub ↗

Check if an event matches this hook

(&self, event: &HookEvent)

Source from the content-addressed store, hash-verified

95
96 /// Check if an event matches this hook
97 pub fn matches(&self, event: &HookEvent) -> bool {
98 // First check event type
99 if event.event_type() != self.event_type {
100 return false;
101 }
102
103 // If there's a matcher, check it
104 if let Some(ref matcher) = self.matcher {
105 matcher.matches(event)
106 } else {
107 true
108 }
109 }
110}
111
112/// Hook execution result

Callers 10

executeMethod · 0.45
globMethod · 0.45
grepMethod · 0.45
matches_patternsFunction · 0.45
search_simpleMethod · 0.45
matching_hooksMethod · 0.45
globMethod · 0.45
grepMethod · 0.45

Calls 1

event_typeMethod · 0.80

Tested by 2

globMethod · 0.36
grepMethod · 0.36