pub trait StreamUpgrade: Stream + Sized {
// Required methods
fn secure_upgrade(
self,
) -> impl Future<Output = Result<Self, SslError>> + Send;
fn secure_upgrade_preview(
self,
options: PreviewConfiguration,
) -> impl Future<Output = Result<(Preview, Self), SslError>> + Send;
fn handshake(&self) -> Option<&TlsHandshake>;
}Expand description
A trait for streams that can be upgraded to a TLS stream.
Required Methods§
Sourcefn secure_upgrade(self) -> impl Future<Output = Result<Self, SslError>> + Send
fn secure_upgrade(self) -> impl Future<Output = Result<Self, SslError>> + Send
Upgrade the stream to a TLS stream.
Sourcefn secure_upgrade_preview(
self,
options: PreviewConfiguration,
) -> impl Future<Output = Result<(Preview, Self), SslError>> + Send
fn secure_upgrade_preview( self, options: PreviewConfiguration, ) -> impl Future<Output = Result<(Preview, Self), SslError>> + Send
Upgrade the stream to a TLS stream, and preview the initial bytes.
Sourcefn handshake(&self) -> Option<&TlsHandshake>
fn handshake(&self) -> Option<&TlsHandshake>
Get the TLS handshake information, if the stream is upgraded.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".