Trait MessageValidator

Source
pub trait MessageValidator: Send + Sync {
    // Required method
    fn validate<'life0, 'life1, 'async_trait>(
        &'life0 self,
        message: &'life1 PlainMessage,
    ) -> Pin<Box<dyn Future<Output = ValidationResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for message validators

Required Methods§

Source

fn validate<'life0, 'life1, 'async_trait>( &'life0 self, message: &'life1 PlainMessage, ) -> Pin<Box<dyn Future<Output = ValidationResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validate a message

Returns Accept if the message passes validation, or Reject with a reason if it fails.

Implementors§