pub trait AsyncTls<C: AsyncRead + AsyncWrite>: Clone {
type Stream;
type Error: Error;
type AcceptFuture: Future<Output = Result<Self::Stream, Self::Error>>;
// Required method
fn accept(&self, stream: C) -> Self::AcceptFuture;
}Expand description
Trait for TLS implementation.
Implementations are provided by the rustls and native-tls features.
Required Associated Types§
Required Methods§
Sourcefn accept(&self, stream: C) -> Self::AcceptFuture
fn accept(&self, stream: C) -> Self::AcceptFuture
Accept a TLS connection on an underlying stream
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<C> AsyncTls<C> for SslContext
Available on crate feature openssl only.
impl<C> AsyncTls<C> for SslContext
Available on crate feature
openssl only.Source§impl<C> AsyncTls<C> for TlsAcceptor
Available on crate feature native-tls only.
impl<C> AsyncTls<C> for TlsAcceptor
Available on crate feature
native-tls only.Source§impl<C: AsyncRead + AsyncWrite + Unpin> AsyncTls<C> for TlsAcceptor
Available on crate feature rustls-core only.
impl<C: AsyncRead + AsyncWrite + Unpin> AsyncTls<C> for TlsAcceptor
Available on crate feature
rustls-core only.Implementors§
Source§impl<C, T> AsyncTls<C> for SpawningHandshakes<T>where
T: AsyncTls<C>,
C: AsyncRead + AsyncWrite,
T::AcceptFuture: Send + 'static,
T::Stream: Send + 'static,
T::Error: Send + 'static,
Available on crate feature rt only.
impl<C, T> AsyncTls<C> for SpawningHandshakes<T>where
T: AsyncTls<C>,
C: AsyncRead + AsyncWrite,
T::AcceptFuture: Send + 'static,
T::Stream: Send + 'static,
T::Error: Send + 'static,
Available on crate feature
rt only.