Skip to main content

Module io

Module io 

Source
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.

Modulesยง

copy_to_bytes ๐Ÿ”’
inspect ๐Ÿ”’
read_buf ๐Ÿ”’
reader_stream ๐Ÿ”’
simplex
Unidirectional byte-oriented channel.
sink_writer ๐Ÿ”’
stream_reader ๐Ÿ”’
write_all_vectored ๐Ÿ”’

Structsยง

CopyToBytes
A helper that wraps a Sink<Bytes> and converts it into a Sink<&'a [u8]> by copying each byte slice into an owned Bytes.
InspectReader
An adapter that lets you inspect the data thatโ€™s being read.
InspectWriter
An adapter that lets you inspect the data thatโ€™s being written.
ReaderStream
Convert an AsyncRead into a Stream of byte chunks.
SinkWriter
Convert a Sink of byte chunks into an AsyncWrite.
StreamReader
Convert a Stream of byte chunks into an AsyncRead.
WriteAllVectored
A future that writes all data from multiple buffers to a writer.

Functionsยง

poll_read_buf
Try to read data from an AsyncRead into an implementer of the BufMut trait.
poll_write_buf
Try to write data from an implementer of the Buf trait to an AsyncWrite, advancing the bufferโ€™s internal cursor.
read_buf
Read data from an AsyncRead into an implementer of the BufMut trait.
write_all_vectored
Like write_all but writes all data from multiple buffers into this writer.