Skip to content

Commit

Permalink
feat: Add ability to get SmtpStream from SmtpTransport (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 authored Oct 14, 2024
1 parent 1fc473f commit 7cc1026
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/smtp_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,21 @@ impl<S: BufRead + Write + Unpin> SmtpTransport<S> {
Ok(transport)
}

/// Gets a mutable reference to the underlying `SmtpStream`.
pub fn get_mut(&mut self) -> &mut SmtpStream<S> {
&mut self.stream
}

/// Gets a reference to the underlying `SmtpStream``.
pub fn get_ref(&mut self) -> &SmtpStream<S> {
&self.stream
}

/// Consumes the SMTP transport and returns the inner `SmtpStream`.
pub fn into_inner(self) -> SmtpStream<S> {
self.stream
}

/// Try to login with the given accepted mechanisms.
pub async fn try_login(
&mut self,
Expand Down

0 comments on commit 7cc1026

Please sign in to comment.