pub trait Hook:
'static
+ Send
+ Sync {
// Required methods
fn should_intercept(&self, kind: EventKind) -> bool;
fn intercept_event(&self, event: Event);
}Required Methods§
Sourcefn should_intercept(&self, kind: EventKind) -> bool
fn should_intercept(&self, kind: EventKind) -> bool
Return true if you want to intercept the given event kind. Self::intercept_event won’t
be called kinds this method returned false
Sourcefn intercept_event(&self, event: Event)
fn intercept_event(&self, event: Event)
Hooks must not block the event stream; this method should be a cheap synchronous call. Delegate heavy work to another thread or spawn async tasks internally.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".