Handler

Trait Handler 

Source
pub trait Handler: Send + Sync {
    // Required methods
    fn recipient_local<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _recipient: &'life1 Mailbox,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn save<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _state: &'life1 SmtpState,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Handler for SMTP events.

Required Methods§

Source

fn recipient_local<'life0, 'life1, 'async_trait>( &'life0 self, _recipient: &'life1 Mailbox, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validate the recipient to be local. Return false to reject the recipient.

Source

fn save<'life0, 'life1, 'async_trait>( &'life0 self, _state: &'life1 SmtpState, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save an email to the system. Return true to accept the email.

Implementors§