#[non_exhaustive]pub enum Matcher {
All,
Bash,
Exact(String),
AnyOf(Vec<String>),
Regex(String),
}Expand description
Which tool calls a hook should match.
Each integration translates this to its harness’s native syntax. For
example, Claude Code accepts a regex when the matcher contains characters
outside [A-Za-z0-9_|], so Matcher::Regex passes through verbatim.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
All
Match any tool call.
Bash
Match the harness’s “Bash”/“Shell”/“shell” tool (whatever it calls command execution). Each integration maps this to the right literal.
Exact(String)
Match exactly this tool name (e.g., "Edit", "Read").
AnyOf(Vec<String>)
Match any of these tool names.
Regex(String)
Match using the harness’s regex syntax (passed through unchanged).
Trait Implementations§
impl Eq for Matcher
impl StructuralPartialEq for Matcher
Auto Trait Implementations§
impl Freeze for Matcher
impl RefUnwindSafe for Matcher
impl Send for Matcher
impl Sync for Matcher
impl Unpin for Matcher
impl UnsafeUnpin for Matcher
impl UnwindSafe for Matcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.