Module tokio_util::io

source ·
Available on crate feature io only.
Expand description

Helpers for IO related tasks.

The stream types are often used in combination with hyper or reqwest, as they allow converting between a hyper Body and AsyncRead.

The SyncIoBridge type converts from the world of async I/O to synchronous I/O; this may often come up when using synchronous APIs inside tokio::task::spawn_blocking.

Structs

A helper that wraps a Sink<Bytes> and converts it into a Sink<&'a [u8]> by copying each byte slice into an owned Bytes.
An adapter that lets you inspect the data that’s being read.
An adapter that lets you inspect the data that’s being written.
Convert an AsyncRead into a Stream of byte chunks.
Convert a Sink of byte chunks into an AsyncWrite.
Convert a Stream of byte chunks into an AsyncRead.

Functions

Try to read data from an AsyncRead into an implementer of the BufMut trait.
Try to write data from an implementer of the Buf trait to an AsyncWrite, advancing the buffer’s internal cursor.
Read data from an AsyncRead into an implementer of the BufMut trait.