pub trait ByteStream:
AsyncRead
+ AsyncWrite
+ Send
+ Sync
+ Unpin {
// Required methods
fn peer_endpoint(&self) -> Option<Endpoint>;
fn local_endpoint(&self) -> Option<Endpoint>;
// Provided method
fn peer_certificates(&self) -> Option<Vec<CertificateDer<'static>>> { ... }
}Expand description
Byte-oriented bidirectional stream.
Implemented by TCP, TLS, Unix, and QUIC streams. Extends
AsyncRead + AsyncWrite for compatibility with IO libraries.
Use framed() to convert into a FramedConn with a codec.
Required Methods§
Sourcefn peer_endpoint(&self) -> Option<Endpoint>
fn peer_endpoint(&self) -> Option<Endpoint>
Remote peer address, if available.
Sourcefn local_endpoint(&self) -> Option<Endpoint>
fn local_endpoint(&self) -> Option<Endpoint>
Local address, if available.
Provided Methods§
Sourcefn peer_certificates(&self) -> Option<Vec<CertificateDer<'static>>>
fn peer_certificates(&self) -> Option<Vec<CertificateDer<'static>>>
Peer certificate chain when the stream authenticates the peer with
X.509 (TLS). Returns None for other streams, QUIC streams included.
For QUIC, use QuicConn::peer_certificates.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".