pub struct ExternalHookHandler { /* private fields */ }Expand description
Adapts an ExternalHookRunner into a HookHandler for the registry.
Implementations§
Source§impl ExternalHookHandler
impl ExternalHookHandler
Sourcepub fn new(
name: impl Into<String>,
kinds: Vec<HookEventKind>,
runner: Arc<dyn ExternalHookRunner>,
) -> Self
pub fn new( name: impl Into<String>, kinds: Vec<HookEventKind>, runner: Arc<dyn ExternalHookRunner>, ) -> Self
Create a handler that delegates to runner.
Sourcepub fn with_tool_matcher(self, pattern: impl Into<String>) -> Self
pub fn with_tool_matcher(self, pattern: impl Into<String>) -> Self
Restrict to tools matching pattern.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Override timeout.
Trait Implementations§
Source§impl HookHandler for ExternalHookHandler
impl HookHandler for ExternalHookHandler
Source§fn event_kinds(&self) -> &[HookEventKind]
fn event_kinds(&self) -> &[HookEventKind]
Event kinds this handler listens to. Empty = all kinds.
Source§fn tool_matcher(&self) -> Option<&str>
fn tool_matcher(&self) -> Option<&str>
Optional tool-name matcher (
*, ?, | alternation). None = all tools.Auto Trait Implementations§
impl !RefUnwindSafe for ExternalHookHandler
impl !UnwindSafe for ExternalHookHandler
impl Freeze for ExternalHookHandler
impl Send for ExternalHookHandler
impl Sync for ExternalHookHandler
impl Unpin for ExternalHookHandler
impl UnsafeUnpin for ExternalHookHandler
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