Trait Transport

Source
pub trait Transport {
    type Ok;
    type Error;

    // Required method
    fn send_raw(
        &self,
        envelope: &Envelope,
        email: &[u8],
    ) -> Result<Self::Ok, Self::Error>;

    // Provided methods
    fn send(&self, message: &Message) -> Result<Self::Ok, Self::Error> { ... }
    fn shutdown(&self) { ... }
}
Expand description

Blocking 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( &self, envelope: &Envelope, email: &[u8], ) -> Result<Self::Ok, Self::Error>

Provided Methods§

Source

fn send(&self, message: &Message) -> Result<Self::Ok, Self::Error>

Available on crate feature builder only.

Sends the email

Source

fn shutdown(&self)

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

Implementors§

Source§

impl Transport for FileTransport

Available on crate feature file-transport only.
Source§

impl Transport for SendmailTransport

Available on crate feature sendmail-transport only.
Source§

impl Transport for SmtpTransport

Available on crate feature smtp-transport only.
Source§

impl Transport for StubTransport