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 underlying transport authenticates
the peer with X.509 (TLS, QUIC). Returns None for plain
TCP/Unix and other unauthenticated transports.