Trait tor_rtcompat::TlsProvider
source · pub trait TlsProvider<S>: Clone + Send + Sync + 'static {
type Connector: TlsConnector<S, Conn = Self::TlsStream> + Send + Sync + Unpin;
type TlsStream: AsyncRead + AsyncWrite + CertifiedConn + Unpin + Send + 'static;
fn tls_connector(&self) -> Self::Connector;
}Expand description
Trait for a runtime that knows how to create TLS connections over
TCP streams of type S.
This is separate from TlsConnector because eventually we may
eventually want to support multiple TlsConnector implementations
that use a single Runtime.
See the TlsConnector documentation for a discussion of the Tor-specific
limitations of this trait: If you are implementing something other than Tor,
this is not the functionality you want.
Required Associated Types§
sourcetype Connector: TlsConnector<S, Conn = Self::TlsStream> + Send + Sync + Unpin
type Connector: TlsConnector<S, Conn = Self::TlsStream> + Send + Sync + Unpin
The Connector object that this provider can return.
sourcetype TlsStream: AsyncRead + AsyncWrite + CertifiedConn + Unpin + Send + 'static
type TlsStream: AsyncRead + AsyncWrite + CertifiedConn + Unpin + Send + 'static
The type of the stream returned by that connector.
Required Methods§
sourcefn tls_connector(&self) -> Self::Connector
fn tls_connector(&self) -> Self::Connector
Return a TLS connector for use with this runtime.
Implementors§
source§impl<S> TlsProvider<S> for AsyncStdNativeTlsRuntimewhere
S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Available on (crate features native-tls or rustls) and crate feature async-std only.
impl<S> TlsProvider<S> for AsyncStdNativeTlsRuntimewhere
S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Available on (crate features
native-tls or rustls) and crate feature async-std only.type Connector = <CompoundRuntime<AsyncStd, AsyncStd, AsyncStd, NativeTlsProvider, AsyncStd> as TlsProvider<S>>::Connector
type TlsStream = <CompoundRuntime<AsyncStd, AsyncStd, AsyncStd, NativeTlsProvider, AsyncStd> as TlsProvider<S>>::TlsStream
source§impl<S> TlsProvider<S> for AsyncStdRustlsRuntimewhere
S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Available on (crate features native-tls or rustls) and crate feature async-std only.
impl<S> TlsProvider<S> for AsyncStdRustlsRuntimewhere
S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Available on (crate features
native-tls or rustls) and crate feature async-std only.type Connector = <CompoundRuntime<AsyncStd, AsyncStd, AsyncStd, RustlsProvider, AsyncStd> as TlsProvider<S>>::Connector
type TlsStream = <CompoundRuntime<AsyncStd, AsyncStd, AsyncStd, RustlsProvider, AsyncStd> as TlsProvider<S>>::TlsStream
source§impl<S> TlsProvider<S> for PreferredRuntimewhere
S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
impl<S> TlsProvider<S> for PreferredRuntimewhere
S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
type Connector = <TokioNativeTlsRuntime as TlsProvider<S>>::Connector
type TlsStream = <TokioNativeTlsRuntime as TlsProvider<S>>::TlsStream
source§impl<S> TlsProvider<S> for NativeTlsProviderwhere
S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Available on (crate features native-tls or rustls) and (crate features async-std or tokio) and crate feature native-tls only.
impl<S> TlsProvider<S> for NativeTlsProviderwhere
S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Available on (crate features
native-tls or rustls) and (crate features async-std or tokio) and crate feature native-tls only.source§impl<S> TlsProvider<S> for RustlsProviderwhere
S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Available on (crate features native-tls or rustls) and (crate features async-std or tokio) and crate feature rustls only.
impl<S> TlsProvider<S> for RustlsProviderwhere
S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Available on (crate features
native-tls or rustls) and (crate features async-std or tokio) and crate feature rustls only.source§impl<S> TlsProvider<S> for TokioNativeTlsRuntimewhere
S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Available on (crate features native-tls or rustls) and crate feature tokio only.
impl<S> TlsProvider<S> for TokioNativeTlsRuntimewhere
S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Available on (crate features
native-tls or rustls) and crate feature tokio only.type Connector = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, TokioRuntimeHandle, NativeTlsProvider, TokioRuntimeHandle> as TlsProvider<S>>::Connector
type TlsStream = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, TokioRuntimeHandle, NativeTlsProvider, TokioRuntimeHandle> as TlsProvider<S>>::TlsStream
source§impl<S> TlsProvider<S> for TokioRustlsRuntimewhere
S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Available on (crate features native-tls or rustls) and crate feature tokio only.
impl<S> TlsProvider<S> for TokioRustlsRuntimewhere
S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
Available on (crate features
native-tls or rustls) and crate feature tokio only.