pub trait TlsProvider<S: StreamOps>:
Clone
+ Send
+ Sync
+ 'static {
type Connector: TlsConnector<S, Conn = Self::TlsStream> + Send + Sync + Unpin;
type TlsStream: AsyncRead + AsyncWrite + StreamOps + CertifiedConn + Unpin + Send + 'static;
// Required methods
fn tls_connector(&self) -> Self::Connector;
fn supports_keying_material_export(&self) -> bool;
}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 + StreamOps + CertifiedConn + Unpin + Send + 'static
type TlsStream: AsyncRead + AsyncWrite + StreamOps + 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.
Sourcefn supports_keying_material_export(&self) -> bool
fn supports_keying_material_export(&self) -> bool
Return true iff the keying material exporters (RFC 5705) is supported.
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.
Implementors§
Source§impl<S> TlsProvider<S> for AsyncStdNativeTlsRuntime
Available on (crate features native-tls or rustls) and crate feature async-std only.
impl<S> TlsProvider<S> for AsyncStdNativeTlsRuntime
native-tls or rustls) and crate feature async-std only.type Connector = <CompoundRuntime<AsyncStd, AsyncStd, RealCoarseTimeProvider, AsyncStd, AsyncStd, NativeTlsProvider, AsyncStd> as TlsProvider<S>>::Connector
type TlsStream = <CompoundRuntime<AsyncStd, AsyncStd, RealCoarseTimeProvider, AsyncStd, AsyncStd, NativeTlsProvider, AsyncStd> as TlsProvider<S>>::TlsStream
Source§impl<S> TlsProvider<S> for AsyncStdRustlsRuntime
Available on (crate features native-tls or rustls) and crate feature async-std only.
impl<S> TlsProvider<S> for AsyncStdRustlsRuntime
native-tls or rustls) and crate feature async-std only.type Connector = <CompoundRuntime<AsyncStd, AsyncStd, RealCoarseTimeProvider, AsyncStd, AsyncStd, RustlsProvider, AsyncStd> as TlsProvider<S>>::Connector
type TlsStream = <CompoundRuntime<AsyncStd, AsyncStd, RealCoarseTimeProvider, AsyncStd, AsyncStd, RustlsProvider, AsyncStd> as TlsProvider<S>>::TlsStream
Source§impl<S> TlsProvider<S> for SmolNativeTlsRuntime
Available on (crate features native-tls or rustls) and crate feature smol only.
impl<S> TlsProvider<S> for SmolNativeTlsRuntime
native-tls or rustls) and crate feature smol only.type Connector = <CompoundRuntime<SmolRuntime, SmolRuntime, RealCoarseTimeProvider, SmolRuntime, SmolRuntime, NativeTlsProvider, SmolRuntime> as TlsProvider<S>>::Connector
type TlsStream = <CompoundRuntime<SmolRuntime, SmolRuntime, RealCoarseTimeProvider, SmolRuntime, SmolRuntime, NativeTlsProvider, SmolRuntime> as TlsProvider<S>>::TlsStream
Source§impl<S> TlsProvider<S> for SmolRustlsRuntime
Available on (crate features native-tls or rustls) and crate feature smol only.
impl<S> TlsProvider<S> for SmolRustlsRuntime
native-tls or rustls) and crate feature smol only.type Connector = <CompoundRuntime<SmolRuntime, SmolRuntime, RealCoarseTimeProvider, SmolRuntime, SmolRuntime, RustlsProvider, SmolRuntime> as TlsProvider<S>>::Connector
type TlsStream = <CompoundRuntime<SmolRuntime, SmolRuntime, RealCoarseTimeProvider, SmolRuntime, SmolRuntime, RustlsProvider, SmolRuntime> as TlsProvider<S>>::TlsStream
Source§impl<S> TlsProvider<S> for PreferredRuntime
impl<S> TlsProvider<S> for PreferredRuntime
type Connector = <TokioNativeTlsRuntime as TlsProvider<S>>::Connector
type TlsStream = <TokioNativeTlsRuntime as TlsProvider<S>>::TlsStream
Source§impl<S> TlsProvider<S> for NativeTlsProvider
Available on (crate features native-tls or rustls) and (crate features async-std or tokio or smol) and crate feature native-tls only.
impl<S> TlsProvider<S> for NativeTlsProvider
native-tls or rustls) and (crate features async-std or tokio or smol) and crate feature native-tls only.Source§impl<S> TlsProvider<S> for RustlsProvider
Available on (crate features native-tls or rustls) and (crate features async-std or tokio or smol) and crate feature rustls only.
impl<S> TlsProvider<S> for RustlsProvider
native-tls or rustls) and (crate features async-std or tokio or smol) and crate feature rustls only.Source§impl<S> TlsProvider<S> for TokioNativeTlsRuntime
Available on (crate features native-tls or rustls) and crate feature tokio only.
impl<S> TlsProvider<S> for TokioNativeTlsRuntime
native-tls or rustls) and crate feature tokio only.type Connector = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, TokioRuntimeHandle, NativeTlsProvider, TokioRuntimeHandle> as TlsProvider<S>>::Connector
type TlsStream = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, TokioRuntimeHandle, NativeTlsProvider, TokioRuntimeHandle> as TlsProvider<S>>::TlsStream
Source§impl<S> TlsProvider<S> for TokioRustlsRuntime
Available on (crate features native-tls or rustls) and crate feature tokio only.
impl<S> TlsProvider<S> for TokioRustlsRuntime
native-tls or rustls) and crate feature tokio only.