Skip to main content

LocalStream

Trait LocalStream 

Source
pub trait LocalStream:
    AsyncRead
    + AsyncWrite
    + Unpin
    + Send { }
Expand description

One end of the local connection, as a duplex stream.

A trait alias in all but name, so the serving functions below take either a real TcpStream or the in-memory duplex a test uses. Without it every test of the serving path would need a real socket, and the failure modes worth testing — a refusal, an upgrade, a mint inside the request path — have nothing to do with sockets.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§