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ยง
- Copy
ToBytes - A helper that wraps a
Sink<Bytes>and converts it into aSink<&'a [u8]>by copying each byte slice into an ownedBytes. - Inspect
Reader - An adapter that lets you inspect the data thatโs being read.
- Inspect
Writer - An adapter that lets you inspect the data thatโs being written.
- Reader
Stream - Convert an
AsyncReadinto aStreamof byte chunks. - Sink
Writer - Convert a
Sinkof byte chunks into anAsyncWrite. - Stream
Reader - Convert a
Streamof byte chunks into anAsyncRead. - Write
AllVectored - A future that writes all data from multiple buffers to a writer.
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. - write_
all_ vectored - Like
write_allbut writes all data from multiple buffers into this writer.