Skip to main content

Connection

Trait Connection 

Source
pub trait Connection: AsyncRead + AsyncWrite {
    // Required method
    fn peer_addr(&self) -> Option<SocketAddr>;
}
Expand description

A stream between a local and remote target.

Required Methods§

Source

fn peer_addr(&self) -> Option<SocketAddr>

Returns the socket address of the remote peer of this connection.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Connection for TcpStream

Implementors§