diff --git a/src/transport/smtp/client/async_connection.rs b/src/transport/smtp/client/async_connection.rs index 194c638..5769349 100644 --- a/src/transport/smtp/client/async_connection.rs +++ b/src/transport/smtp/client/async_connection.rs @@ -6,7 +6,8 @@ use futures_util::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; use super::async_net::AsyncTokioStream; #[cfg(feature = "tracing")] use super::escape_crlf; -use super::{AsyncNetworkStream, ClientCodec, TlsParameters}; +#[allow(deprecated)] +use super::{async_net::AsyncNetworkStream, ClientCodec, TlsParameters}; use crate::{ transport::smtp::{ authentication::{Credentials, Mechanism}, @@ -35,6 +36,7 @@ macro_rules! try_smtp ( pub struct AsyncSmtpConnection { /// TCP stream between client and server /// Value is None before connection + #[allow(deprecated)] stream: BufReader, /// Panic state panic: bool, @@ -56,6 +58,7 @@ impl AsyncSmtpConnection { stream: Box, hello_name: &ClientId, ) -> Result { + #[allow(deprecated)] let stream = AsyncNetworkStream::use_existing_tokio1(stream); Self::connect_impl(stream, hello_name).await } @@ -98,6 +101,7 @@ impl AsyncSmtpConnection { tls_parameters: Option, local_address: Option, ) -> Result { + #[allow(deprecated)] let stream = AsyncNetworkStream::connect_tokio1(server, timeout, tls_parameters, local_address) .await?; @@ -114,10 +118,12 @@ impl AsyncSmtpConnection { hello_name: &ClientId, tls_parameters: Option, ) -> Result { + #[allow(deprecated)] let stream = AsyncNetworkStream::connect_asyncstd1(server, timeout, tls_parameters).await?; Self::connect_impl(stream, hello_name).await } + #[allow(deprecated)] async fn connect_impl( stream: AsyncNetworkStream, hello_name: &ClientId, @@ -245,6 +251,7 @@ impl AsyncSmtpConnection { } /// Sets the underlying stream + #[allow(deprecated)] pub fn set_stream(&mut self, stream: AsyncNetworkStream) { self.stream = BufReader::new(stream); } diff --git a/src/transport/smtp/client/async_net.rs b/src/transport/smtp/client/async_net.rs index ed5c984..2c0173f 100644 --- a/src/transport/smtp/client/async_net.rs +++ b/src/transport/smtp/client/async_net.rs @@ -44,6 +44,10 @@ use crate::transport::smtp::{error, Error}; /// A network stream #[derive(Debug)] +#[deprecated( + since = "0.11.14", + note = "This struct was not meant to be made public" +)] pub struct AsyncNetworkStream { inner: InnerAsyncNetworkStream, } @@ -89,6 +93,7 @@ enum InnerAsyncNetworkStream { None, } +#[allow(deprecated)] impl AsyncNetworkStream { fn new(inner: InnerAsyncNetworkStream) -> Self { if let InnerAsyncNetworkStream::None = inner { @@ -543,6 +548,7 @@ impl AsyncNetworkStream { } } +#[allow(deprecated)] impl FuturesAsyncRead for AsyncNetworkStream { fn poll_read( mut self: Pin<&mut Self>, @@ -598,6 +604,7 @@ impl FuturesAsyncRead for AsyncNetworkStream { } } +#[allow(deprecated)] impl FuturesAsyncWrite for AsyncNetworkStream { fn poll_write( mut self: Pin<&mut Self>, diff --git a/src/transport/smtp/client/mod.rs b/src/transport/smtp/client/mod.rs index bb225b4..df2f742 100644 --- a/src/transport/smtp/client/mod.rs +++ b/src/transport/smtp/client/mod.rs @@ -28,6 +28,7 @@ use std::fmt::Debug; #[cfg(any(feature = "tokio1", feature = "async-std1"))] pub use self::async_connection::AsyncSmtpConnection; #[cfg(any(feature = "tokio1", feature = "async-std1"))] +#[allow(deprecated)] pub use self::async_net::AsyncNetworkStream; #[cfg(feature = "tokio1")] pub use self::async_net::AsyncTokioStream;