[][src]Struct async_smtp::smtp::client::InnerClient

pub struct InnerClient<S: Write + Read = NetworkStream> { /* fields omitted */ }

Structure that implements the SMTP client

Implementations

impl<S: Write + Read> InnerClient<S>[src]

pub fn new() -> InnerClient<S>[src]

Creates a new SMTP client

It does not connects to the server, but only creates the Client

impl<S: Connector + Write + Read + Unpin> InnerClient<S>[src]

pub async fn close<'_>(__arg0: Pin<&'_ mut Self>) -> Result<(), Error>[src]

Closes the SMTP transaction if possible.

pub fn set_stream(&mut self, stream: S)[src]

Sets the underlying stream.

pub async fn upgrade_tls_stream<'_>(
    self,
    tls_parameters: &'_ ClientTlsParameters
) -> Result<Self>
[src]

Upgrades the underlying connection to SSL/TLS.

pub fn is_encrypted(&self) -> bool[src]

Tells if the underlying stream is currently encrypted

pub fn set_timeout(&mut self, duration: Option<Duration>)[src]

Set read and write timeout.

pub fn timeout(&mut self) -> Option<&Duration>[src]

Get the read and write timeout.

pub async fn connect<'_, '_, '_, A: ToSocketAddrs>(
    &'_ mut self,
    addr: &'_ A,
    timeout: Option<Duration>,
    tls_parameters: Option<&'_ ClientTlsParameters>
) -> Result<(), Error>
[src]

Connects to the configured server

pub async fn connect_with_stream<'_>(
    &'_ mut self,
    stream: S
) -> Result<(), Error>
[src]

Connects to a pre-defined stream

pub fn is_connected(&self) -> bool[src]

Checks if the underlying server socket is connected

pub async fn auth<'_, '_>(
    __arg0: Pin<&'_ mut Self>,
    mechanism: Mechanism,
    credentials: &'_ Credentials
) -> SmtpResult
[src]

Sends an AUTH command with the given mechanism, and handles challenge if needed

pub async fn message<'_, T: Read + Unpin>(
    __arg0: Pin<&'_ mut Self>,
    message: T
) -> SmtpResult
[src]

Sends the message content.

pub async fn command<'_, C: Display>(
    __arg0: Pin<&'_ mut Self>,
    command: C
) -> SmtpResult
[src]

Send the given SMTP command to the server.

pub async fn read_response<'_>(__arg0: Pin<&'_ mut Self>) -> SmtpResult[src]

Read an SMTP response from the wire.

Trait Implementations

impl<S: Debug + Write + Read> Debug for InnerClient<S>[src]

impl<S: Write + Read> Default for InnerClient<S>[src]

impl<S: Write + Read> PinnedDrop for InnerClient<S>[src]

impl<'pin, S: Write + Read> Unpin for InnerClient<S> where
    __InnerClient<'pin, S>: Unpin
[src]

impl<S: Write + Read> UnsafeUnpin for InnerClient<S>[src]

Auto Trait Implementations

impl<S> RefUnwindSafe for InnerClient<S> where
    S: RefUnwindSafe

impl<S> Send for InnerClient<S> where
    S: Send

impl<S> Sync for InnerClient<S> where
    S: Sync

impl<S> UnwindSafe for InnerClient<S> where
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.