Skip to main content

Hook

Trait Hook 

Source
pub trait Hook {
    // Required methods
    fn should_intercept(&self, kind: EventKind) -> bool;
    fn intercept_event(&mut self, event: Event);
}

Required Methods§

Source

fn should_intercept(&self, kind: EventKind) -> bool

Source

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.

Implementors§

Source§

impl<C: ClientApi> Hook for XftpClient<C>

Available on crate feature xftp only.