Module io
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
-
CopyToBytes
A helper that wraps a
Sink<Bytes>and converts it into aSink<&'a [u8]>by copying each byte slice into an ownedBytes. - 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
AsyncReadinto aStreamof byte chunks. -
SinkWriter
Convert a
Sinkof byte chunks into anAsyncWrite. -
StreamReader
Convert a
Streamof byte chunks into anAsyncRead.
Functions
-
poll_read_buf
Try to read data from an
AsyncReadinto an implementer of theBufMuttrait. -
poll_write_buf
Try to write data from an implementer of the
Buftrait to anAsyncWrite, advancing the buffer's internal cursor. -
read_buf
Read data from an
AsyncReadinto an implementer of theBufMuttrait.