MessageDispatcherInterface

Trait MessageDispatcherInterface 

Source
trait MessageDispatcherInterface: Send + Sync {
    // Required methods
    fn trigger<'life0, 'life1, 'async_trait>(
        &'life0 self,
        stream: &'life1 mut ReadHalf<Box<dyn PtStream + 'static>>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn trigger_error<'life0, 'async_trait>(
        &'life0 self,
        err: Error,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn metering_score<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn as_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync>;
}
Expand description

Generic interface for the message dispatcher.

Required Methods§

Source

fn trigger<'life0, 'life1, 'async_trait>( &'life0 self, stream: &'life1 mut ReadHalf<Box<dyn PtStream + 'static>>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn trigger_error<'life0, 'async_trait>( &'life0 self, err: Error, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn metering_score<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn as_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync>

Implementors§

Source§

impl<M: Message> MessageDispatcherInterface for MessageDispatcher<M>

Local implementation of the Message Dispatcher Interface