general_mq::connection

Trait EventHandler

Source
pub trait EventHandler: Send + Sync {
    // Required methods
    fn on_error<'life0, 'async_trait>(
        &'life0 self,
        handler_id: String,
        conn: Arc<dyn GmqConnection>,
        err: Box<dyn StdError + Send + Sync>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn on_status<'life0, 'async_trait>(
        &'life0 self,
        handler_id: String,
        conn: Arc<dyn GmqConnection>,
        status: Status,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The event handler for connections.

Required Methods§

Source

fn on_error<'life0, 'async_trait>( &'life0 self, handler_id: String, conn: Arc<dyn GmqConnection>, err: Box<dyn StdError + Send + Sync>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Triggered when there are errors.

Source

fn on_status<'life0, 'async_trait>( &'life0 self, handler_id: String, conn: Arc<dyn GmqConnection>, status: Status, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Triggered by Status.

Implementors§