Trait rings_core::message::handlers::HandleMsg

source ·
pub trait HandleMsg<T> {
    // Required method
    fn handle<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        ctx: &'life1 MessagePayload,
        msg: &'life2 T
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Generic trait for handle message ,inspired by Actor-Model.

Required Methods§

source

fn handle<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 MessagePayload, msg: &'life2 T ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Message handler.

Implementors§