Check if an event matches this hook
(&self, event: &HookEvent)
| 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 |