Skip to main content

Connection

Trait Connection 

Source
pub trait Connection:
    AsyncRead
    + AsyncWrite
    + Unpin
    + Send {
    // Required method
    fn transport(&self) -> &'static str;
}
Expand description

Trait abstracting an accepted connection so the lifecycle can speak to either a Unix-socket stream or a TCP stream uniformly.

Required Methods§

Source

fn transport(&self) -> &'static str

Stable string identifying the transport (“unix”/“tcp”). Used for activity-log attribution; not echoed on the wire.

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

Source§

fn transport(&self) -> &'static str

Source§

impl Connection for UnixStream

Available on Unix only.
Source§

fn transport(&self) -> &'static str

Implementors§