Skip to main content

Connection

Trait Connection 

Source
pub trait Connection: AsyncRead + AsyncWrite {
    // Required methods
    fn scheme(&self) -> Scheme;
    fn local_addr(&self) -> Result<SocketAddr>;
    fn peer_addr(&self) -> Result<SocketAddr>;
}
Available on crate feature server only.
Expand description

HTTP connection.

Required Methods§

Source

fn scheme(&self) -> Scheme

Get the HTTP scheme of the connection.

Source

fn local_addr(&self) -> Result<SocketAddr>

Get the local address of the connection.

Source

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

Get the peer address of the 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§