Skip to main content

EventSubscriber

Trait EventSubscriber 

Source
pub trait EventSubscriber: Send + Sync {
    // Required method
    fn handle_event(&self, event: HttpEvent) -> BoxFuture<'_, ()>;
}
Expand description

Event subscriber trait for TAP HTTP events

Note: This trait is not object-safe because of the async fn. For dynamic dispatch, we use a type-erased wrapper.

Required Methods§

Source

fn handle_event(&self, event: HttpEvent) -> BoxFuture<'_, ()>

Handle an HTTP event

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> EventSubscriber for T
where T: Send + Sync + 'static + for<'a> HandleEvent<'a>,

Implementation for async handlers