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;

    // Required method
    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§

source

type Connector: TlsConnector<S, Conn = Self::TlsStream> + Send + Sync + Unpin

The Connector object that this provider can return.

source

type TlsStream: AsyncRead + AsyncWrite + CertifiedConn + Unpin + Send + 'static

The type of the stream returned by that connector.

Required Methods§

source

fn tls_connector(&self) -> Self::Connector

Return a TLS connector for use with this runtime.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<S> TlsProvider<S> for AsyncStdNativeTlsRuntime
where S: AsyncRead + AsyncWrite + Unpin + Send + 'static,

Available on (crate features native-tls or rustls) and crate feature async-std only.
source§

impl<S> TlsProvider<S> for AsyncStdRustlsRuntime
where S: AsyncRead + AsyncWrite + Unpin + Send + 'static,

Available on (crate features native-tls or rustls) and crate feature async-std only.
source§

impl<S> TlsProvider<S> for PreferredRuntime
where S: AsyncRead + AsyncWrite + Unpin + Send + 'static,

source§

impl<S> TlsProvider<S> for NativeTlsProvider
where 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.
§

type Connector = NativeTlsConnector<S>

§

type TlsStream = TlsStream<S>

source§

impl<S> TlsProvider<S> for RustlsProvider
where 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.
§

type Connector = RustlsConnector<S>

§

type TlsStream = TlsStream<S>

source§

impl<S> TlsProvider<S> for TokioNativeTlsRuntime
where S: AsyncRead + AsyncWrite + Unpin + Send + 'static,

Available on (crate features native-tls or rustls) and crate feature tokio only.
§

type Connector = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, NativeTlsProvider, TokioRuntimeHandle> as TlsProvider<S>>::Connector

§

type TlsStream = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, NativeTlsProvider, TokioRuntimeHandle> as TlsProvider<S>>::TlsStream

source§

impl<S> TlsProvider<S> for TokioRustlsRuntime
where S: AsyncRead + AsyncWrite + Unpin + Send + 'static,

Available on (crate features native-tls or rustls) and crate feature tokio only.
§

type Connector = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, RustlsProvider, TokioRuntimeHandle> as TlsProvider<S>>::Connector

§

type TlsStream = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, RustlsProvider, TokioRuntimeHandle> as TlsProvider<S>>::TlsStream

source§

impl<SpawnR, SleepR, CoarseTimeR, TcpR, TlsR, UdpR, S> TlsProvider<S> for CompoundRuntime<SpawnR, SleepR, CoarseTimeR, TcpR, TlsR, UdpR>
where TcpR: TcpProvider, TlsR: TlsProvider<S>, SleepR: Clone + Send + Sync + 'static, CoarseTimeR: Clone + Send + Sync + 'static, SpawnR: Clone + Send + Sync + 'static, UdpR: Clone + Send + Sync + 'static,

§

type Connector = <TlsR as TlsProvider<S>>::Connector

§

type TlsStream = <TlsR as TlsProvider<S>>::TlsStream