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§
sourcefn into_stream(self) -> IntoStream<Self>
Available on crate feature stream only.
fn into_stream(self) -> IntoStream<Self>
stream only.Wrap the transport in a converter which produces a Stream
sourcefn with_tls(self, config: Arc<ClientConfig>) -> TlsTransport<Self>where
Self: Sized,
Available on crate feature tls only.
fn with_tls(self, config: Arc<ClientConfig>) -> TlsTransport<Self>where
Self: Sized,
tls only.Wrap the transport in a TLS layer.
sourcefn with_default_tls(self) -> TlsTransport<Self>where
Self: Sized,
Available on crate feature tls only.
fn with_default_tls(self) -> TlsTransport<Self>where
Self: Sized,
tls only.Wrap the transport in a TLS layer configured with a default client configuration.
sourcefn without_tls(self) -> TlsTransport<Self>where
Self: Sized,
fn without_tls(self) -> TlsTransport<Self>where
Self: Sized,
Wrap the transport in a no-TLS layer.
sourcefn with_optional_tls(
self,
config: Option<Arc<ClientConfig>>,
) -> TlsTransport<Self>where
Self: Sized,
Available on crate feature tls only.
fn with_optional_tls(
self,
config: Option<Arc<ClientConfig>>,
) -> TlsTransport<Self>where
Self: Sized,
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.