Skip to main content

CallbackHandler

Trait CallbackHandler 

Source
pub trait CallbackHandler: Send + Sync {
    // Required methods
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        payload: CallbackPayload,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn name(&self) -> &str;
    fn is_enabled_for(&self, event_type: CallbackEventType) -> bool;
}
Expand description

Callback handler trait.

Required Methods§

Source

fn handle<'life0, 'async_trait>( &'life0 self, payload: CallbackPayload, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle a callback event.

Source

fn name(&self) -> &str

Get the handler name.

Source

fn is_enabled_for(&self, event_type: CallbackEventType) -> bool

Check if the handler is enabled for an event type.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§