pub struct Hook {
pub id: String,
pub event_type: HookEventType,
pub matcher: Option<HookMatcher>,
pub config: HookConfig,
}Expand description
Hook definition
Fields§
§id: StringUnique hook identifier
event_type: HookEventTypeEvent type that triggers this hook
matcher: Option<HookMatcher>Event matcher (optional, None matches all events)
config: HookConfigHook configuration
Implementations§
Source§impl Hook
impl Hook
Sourcepub fn new(id: impl Into<String>, event_type: HookEventType) -> Self
pub fn new(id: impl Into<String>, event_type: HookEventType) -> Self
Create a new hook
Sourcepub fn with_matcher(self, matcher: HookMatcher) -> Self
pub fn with_matcher(self, matcher: HookMatcher) -> Self
Set the matcher
Sourcepub fn with_config(self, config: HookConfig) -> Self
pub fn with_config(self, config: HookConfig) -> Self
Set the configuration
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Hook
impl<'de> Deserialize<'de> for Hook
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Hook
impl RefUnwindSafe for Hook
impl Send for Hook
impl Sync for Hook
impl Unpin for Hook
impl UnsafeUnpin for Hook
impl UnwindSafe for Hook
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