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§

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.

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.
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.
source§

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

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.
§

type Connector = NativeTlsConnector<S>

§

type TlsStream = TlsStream<S>

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.
§

type Connector = RustlsConnector<S>

§

type TlsStream = TlsStream<S>

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.
§

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.
§

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

§

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

source§

impl<SpawnR, SleepR, TcpR, TlsR, UdpR, S> TlsProvider<S> for CompoundRuntime<SpawnR, SleepR, TcpR, TlsR, UdpR>where
    TcpR: TcpProvider,
    TlsR: TlsProvider<S>,
    SleepR: 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