hyperdriver::client::conn::transport

Trait TransportExt

source
pub trait TransportExt: Transport {
    // Provided methods
    fn into_stream(self) -> IntoStream<Self>
       where Self::IO: Into<Stream> + AsyncRead + AsyncWrite + Unpin + Send + 'static,
             <<Self as Transport>::IO as HasConnectionInfo>::Addr: Into<BraidAddr> { ... }
    fn with_tls(self, config: Arc<ClientConfig>) -> TlsTransport<Self>
       where Self: Sized { ... }
    fn with_default_tls(self) -> TlsTransport<Self>
       where Self: Sized { ... }
    fn without_tls(self) -> TlsTransport<Self>
       where Self: Sized { ... }
    fn with_optional_tls(
        self,
        config: Option<Arc<ClientConfig>>,
    ) -> TlsTransport<Self>
       where Self: Sized { ... }
}
Available on crate feature client only.
Expand description

Extension trait for Transports to provide additional configuration options.

Provided Methods§

source

fn into_stream(self) -> IntoStream<Self>
where Self::IO: Into<Stream> + AsyncRead + AsyncWrite + Unpin + Send + 'static, <<Self as Transport>::IO as HasConnectionInfo>::Addr: Into<BraidAddr>,

Available on crate feature stream only.

Wrap the transport in a converter which produces a Stream

source

fn with_tls(self, config: Arc<ClientConfig>) -> TlsTransport<Self>
where Self: Sized,

Available on crate feature tls only.

Wrap the transport in a TLS layer.

source

fn with_default_tls(self) -> TlsTransport<Self>
where Self: Sized,

Available on crate feature tls only.

Wrap the transport in a TLS layer configured with a default client configuration.

source

fn without_tls(self) -> TlsTransport<Self>
where Self: Sized,

Wrap the transport in a no-TLS layer.

source

fn with_optional_tls( self, config: Option<Arc<ClientConfig>>, ) -> TlsTransport<Self>
where Self: Sized,

Available on crate feature tls only.

Wrap the transport in a TLS layer if the given config is Some, otherwise wrap it in a no-TLS layer.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> TransportExt for T
where T: Transport,