Skip to content

Commit 7cc1026

Browse files
authored
feat: Add ability to get SmtpStream from SmtpTransport (#64)
1 parent 1fc473f commit 7cc1026

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/smtp_client.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,21 @@ impl<S: BufRead + Write + Unpin> SmtpTransport<S> {
123123
Ok(transport)
124124
}
125125

126+
/// Gets a mutable reference to the underlying `SmtpStream`.
127+
pub fn get_mut(&mut self) -> &mut SmtpStream<S> {
128+
&mut self.stream
129+
}
130+
131+
/// Gets a reference to the underlying `SmtpStream``.
132+
pub fn get_ref(&mut self) -> &SmtpStream<S> {
133+
&self.stream
134+
}
135+
136+
/// Consumes the SMTP transport and returns the inner `SmtpStream`.
137+
pub fn into_inner(self) -> SmtpStream<S> {
138+
self.stream
139+
}
140+
126141
/// Try to login with the given accepted mechanisms.
127142
pub async fn try_login(
128143
&mut self,

0 commit comments

Comments
 (0)