Trait AsyncTransport

Source
pub trait AsyncTransport {
    type Ok;
    type Error;

    // Required method
    fn send_raw<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        envelope: &'life1 Envelope,
        email: &'life2 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<Self::Ok, Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;

    // Provided methods
    fn send<'life0, 'async_trait>(
        &'life0 self,
        message: Message,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Ok, Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: Sync + 'async_trait { ... }
    fn shutdown<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: Sync + 'async_trait { ... }
}
Expand description

Async Transport method for emails

Required Associated Types§

Source

type Ok

Response produced by the Transport

Source

type Error

Error produced by the Transport

Required Methods§

Source

fn send_raw<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, envelope: &'life1 Envelope, email: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = Result<Self::Ok, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Provided Methods§

Source

fn send<'life0, 'async_trait>( &'life0 self, message: Message, ) -> Pin<Box<dyn Future<Output = Result<Self::Ok, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sync + 'async_trait,

Sends the email

Source

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

Shuts down the transport. Future calls to Self::send and Self::send_raw might fail.

Implementors§