Expand description
Asynchronous I/O.
This module is the asynchronous version of std::io
. It defines two
traits, AsyncRead
and
AsyncWrite
, which mirror the Read
and Write
traits of the standard library. However, these traits integrate with the
asynchronous task system, so that if an I/O object isn’t ready for
reading (or writing), the thread is not blocked, and instead the current
task is queued to be woken when I/O is ready.
In addition, the AsyncReadExt
and
AsyncWriteExt
extension traits offer a variety
of useful combinators for operating with asynchronous I/O objects,
including ways to work with them using futures, streams and sinks.
Structs§
- Allow
StdIo - A simple wrapper type which allows types which implement only
implement
std::io::Read
orstd::io::Write
to be used in contexts which expect anAsyncRead
orAsyncWrite
. - Close
- A future used to fully close an I/O object.
- Copy
Into - A future which will copy all data from a reader into a writer.
- Error
- The error type for I/O operations of the
Read
,Write
,Seek
, and associated traits. - Flush
- A future used to fully flush an I/O object.
- Initializer
- A type used to conditionally initialize buffers passed to
AsyncRead
methods, modeled afterstd
. - IoVec
- A specialized byte slice type for performing vectored I/O operations.
- Read
- A future which can be used to easily read available number of bytes to fill a buffer.
- Read
Exact - A future which can be used to easily read exactly enough bytes to fill a buffer.
- Read
Half - The readable half of an object returned from
AsyncRead::split
. - Read
ToEnd - A future which can be used to easily read the entire contents of a stream into a vector.
- Window
- A owned window around an underlying buffer.
- Write
All - A future used to write the entire contents of some data to a stream.
- Write
Half - The writable half of an object returned from
AsyncRead::split
.
Enums§
- Error
Kind - A list specifying general categories of I/O error.
Traits§
- Async
Read - Read bytes asynchronously.
- Async
Read Ext - An extension trait which adds utility methods to
AsyncRead
types. - Async
Write - Write bytes asynchronously.
- Async
Write Ext - An extension trait which adds utility methods to
AsyncWrite
types.