Struct async_smtp::smtp::SmtpTransport
source · [−]pub struct SmtpTransport { /* private fields */ }
Expand description
Structure that implements the high level SMTP client
Implementations
sourceimpl<'a> SmtpTransport
impl<'a> SmtpTransport
sourcepub fn new(builder: SmtpClient) -> SmtpTransport
pub fn new(builder: SmtpClient) -> SmtpTransport
Creates a new SMTP client
It does not connect to the server, but only creates the SmtpTransport
sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Returns true if there is currently an established connection.
sourcepub async fn connect(&mut self) -> Result<(), Error>
pub async fn connect(&mut self) -> Result<(), Error>
Try to connect with the configured connection type, if not already connected.
sourcepub async fn command<C: Display>(&mut self, command: C) -> SmtpResult
pub async fn command<C: Display>(&mut self, command: C) -> SmtpResult
Send the given SMTP command to the server.
sourcepub async fn close(&mut self) -> Result<(), Error>
pub async fn close(&mut self) -> Result<(), Error>
Reset the client state and close the connection.
sourcepub async fn connect_and_send(&mut self, email: SendableEmail) -> SmtpResult
pub async fn connect_and_send(&mut self, email: SendableEmail) -> SmtpResult
Try to connect and then send a message.
Trait Implementations
sourceimpl<'a> Transport<'a> for SmtpTransport
impl<'a> Transport<'a> for SmtpTransport
sourcefn send<'life0, 'async_trait>(
&'life0 mut self,
email: SendableEmail
) -> Pin<Box<dyn Future<Output = SmtpResult> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 mut self,
email: SendableEmail
) -> Pin<Box<dyn Future<Output = SmtpResult> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Sends an email
fn send_with_timeout<'life0, 'life1, 'async_trait>(
&'life0 mut self,
email: SendableEmail,
timeout: Option<&'life1 Duration>
) -> Pin<Box<dyn Future<Output = Self::Result> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
impl<'pin> Unpin for SmtpTransport where
__SmtpTransport<'pin>: Unpin,
Auto Trait Implementations
impl RefUnwindSafe for SmtpTransport
impl Send for SmtpTransport
impl Sync for SmtpTransport
impl UnwindSafe for SmtpTransport
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more