MessageInterceptor

Trait MessageInterceptor 

Source
pub trait MessageInterceptor:
    Send
    + Sync
    + Debug {
    // Required methods
    fn before_process<'life0, 'life1, 'async_trait>(
        &'life0 self,
        msg: &'life1 Message,
    ) -> Pin<Box<dyn Future<Output = Result<(), RuleError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn after_process<'life0, 'life1, 'async_trait>(
        &'life0 self,
        msg: &'life1 Message,
    ) -> Pin<Box<dyn Future<Output = Result<(), RuleError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

消息拦截器特征,用于在消息处理的不同阶段进行拦截处理

Required Methods§

Source

fn before_process<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 Message, ) -> Pin<Box<dyn Future<Output = Result<(), RuleError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

消息处理前的拦截处理

§Arguments
  • msg - 待处理的消息
Source

fn after_process<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 Message, ) -> Pin<Box<dyn Future<Output = Result<(), RuleError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

消息处理后的拦截处理

§Arguments
  • msg - 处理后的消息

Implementors§