-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add ability to get SmtpStream from SmtpTransport #64
Conversation
src/smtp_client.rs
Outdated
@@ -123,6 +123,11 @@ impl<S: BufRead + Write + Unpin> SmtpTransport<S> { | |||
Ok(transport) | |||
} | |||
|
|||
/// Get the underlying SmtpStream. | |||
pub fn get_stream(&mut self) -> &mut SmtpStream<S> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is usually named get_mut()
, see for example https://docs.rs/tokio-rustls/latest/tokio_rustls/enum.TlsStream.html and https://docs.rs/tokio/latest/tokio/io/struct.BufWriter.html#method.get_mut
I would also provide get_ref()
before it to get non-mutable reference, and maybe also into_inner()
which is another common method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Added get_mut, get_ref and into_inner
Thanks! |
Thanks! Any chance you can tag a 0.9.2? |
Just tagged and published |
Thanks @link2xt for your reactivity |
I am the author of https://github.com/reacherhq/check-if-email-exists, and I currently use async-smtp 0.6. I would like to upgrade to 0.9, but I'm blocked on one small feature missing in this library.
The check-if-email-exists lib manually sends the EHLO, MAIL FROM, RCPT commands, but does not actually send the email. Looking at the SmtpClient, it only exposes the
send()
function, which does MAIL FROM, RCPT, DATA and sending. It seems like there's no way to have more granularity on the SMTP commands.I would like to propose this small addition so that I can upgrade to 0.9 and continue using this great library without forking.
Thanks for considering.