Skip to main content

ReadWrite

Trait ReadWrite 

Source
pub trait ReadWrite:
    AsyncRead
    + AsyncWrite
    + Unpin
    + Send
    + Sync
    + Debug { }
Expand description

A marker trait for types that can act as the underlying transport.

Any type that implements tokio::io::AsyncRead + tokio::io::AsyncWrite

  • Unpin + Send + Sync + std::fmt::Debug automatically satisfies this bound via the blanket impl below. Tokio’s TcpStream, UnixStream, and the TUN-device wrappers used in tests all qualify.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§