pub trait TlsConnector:
Send
+ Sync
+ 'static {
// Required method
fn connect(
&self,
stream: TlsStream,
server_name: ServerName<'static>,
) -> Pin<Box<dyn Future<Output = Result<TlsStream, TlsError>> + Send + '_>>;
}Expand description
Types that can establish outbound TLS connections.
Implementations wrap a transport-layer stream in a TLS client handshake,
producing a TlsStream on success. The trait is object-safe: it can be
used through Box<dyn TlsConnector> or Arc<dyn TlsConnector>.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".