pub trait Hook: 'static + Send {
// Required methods
fn should_intercept(&self, kind: EventKind) -> bool;
fn intercept_event(&mut self, event: Event);
}Required Methods§
fn should_intercept(&self, kind: EventKind) -> bool
Sourcefn intercept_event(&mut self, event: Event)
fn intercept_event(&mut 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".