use futures_x_io::{AsyncRead, AsyncWrite};
use crate::tls::TlsClientUpgrader;
use crate::upgradable::{UpgradableAsyncStream, Upgrader};
pub type ImapClientInnerStream<S, SU> = UpgradableAsyncStream<S, SU>;
impl<S, SU> ImapClientInnerStream<S, SU>
where
S: AsyncRead + AsyncWrite + Unpin,
SU: TlsClientUpgrader<S> + Unpin,
<SU as Upgrader<S>>::Output: AsyncRead + AsyncWrite + Unpin,
{
pub fn with_imap_client(stream: S, tls_upgrader: SU) -> Self {
Self::new(stream, tls_upgrader)
}
}
pub type SmtpClientInnerStream<S, SU> = UpgradableAsyncStream<S, SU>;
impl<S, SU> SmtpClientInnerStream<S, SU>
where
S: AsyncRead + AsyncWrite + Unpin,
SU: TlsClientUpgrader<S> + Unpin,
<SU as Upgrader<S>>::Output: AsyncRead + AsyncWrite + Unpin,
{
pub fn with_smtp_client(stream: S, tls_upgrader: SU) -> Self {
Self::new(stream, tls_upgrader)
}
}