Expand description
Asynchronous I/O.
This module is the asynchronous version of std::io. It defines four
traits, AsyncRead, AsyncWrite, AsyncSeek, and AsyncBufRead,
which mirror the Read, Write, Seek, and BufRead 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, AsyncWriteExt, AsyncSeekExt, and
AsyncBufReadExt 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.
This module is only available when the std feature of this
library is activated, and it is activated by default.
Structs§
- Allow
StdIo - A simple wrapper type which allows types which implement only
implement
std::io::Readorstd::io::Writeto be used in contexts which expect anAsyncReadorAsyncWrite. - BufReader
- The
BufReaderstruct adds buffering to any reader. - BufWriter
- Wraps a writer and buffers its output.
- Chain
- Reader for the
chainmethod. - Close
- Future for the
closemethod. - Copy
- Future for the
copy()function. - CopyBuf
- Future for the
copy_buf()function. - Copy
BufAbortable - Future for the
copy_buf_abortable()function. - Cursor
- A
Cursorwraps an in-memory buffer and provides it with aAsyncSeekimplementation. - Empty
- Reader for the
empty()function. - Error
- The error type for I/O operations of the
Read,Write,Seek, and associated traits. - FillBuf
- Future for the
fill_bufmethod. - Flush
- Future for the
flushmethod. - Into
Sink - Sink for the
into_sinkmethod. - IoSlice
- A buffer type used with
Write::write_vectored. - IoSlice
Mut - A buffer type used with
Read::read_vectored. - Line
Writer - Wrap a writer, like
BufWriterdoes, but prioritizes buffering lines - Lines
- Stream for the
linesmethod. - Read
- Future for the
readmethod. - Read
Exact - Future for the
read_exactmethod. - Read
Half - The readable half of an object returned from
AsyncRead::split. - Read
Line - Future for the
read_linemethod. - Read
ToEnd - Future for the
read_to_endmethod. - Read
ToString - Future for the
read_to_stringmethod. - Read
Until - Future for the
read_untilmethod. - Read
Vectored - Future for the
read_vectoredmethod. - Repeat
- Reader for the
repeat()function. - Reunite
Error - Error indicating a
ReadHalf<T>andWriteHalf<T>were not two halves of aAsyncRead + AsyncWrite, and thus could not bereunited. - SeeK
Relative - Future for the
BufReader::seek_relativemethod. - Seek
- Future for the
seekmethod. - Sink
- Writer for the
sink()function. - Take
- Reader for the
takemethod. - Window
- An owned window around an underlying buffer.
- Write
- Future for the
writemethod. - Write
All - Future for the
write_allmethod. - Write
AllVectored - Future for the
write_all_vectoredmethod. - Write
Half - The writable half of an object returned from
AsyncRead::split. - Write
Vectored - Future for the
write_vectoredmethod.
Enums§
- Error
Kind - A list specifying general categories of I/O error.
- Seek
From - Enumeration of possible methods to seek within an I/O object.
Traits§
- Async
BufRead - Read bytes asynchronously.
- Async
BufRead Ext - An extension trait which adds utility methods to
AsyncBufReadtypes. - Async
Read - Read bytes asynchronously.
- Async
Read Ext - An extension trait which adds utility methods to
AsyncReadtypes. - Async
Seek - Seek bytes asynchronously.
- Async
Seek Ext - An extension trait which adds utility methods to
AsyncSeektypes. - Async
Write - Write bytes asynchronously.
- Async
Write Ext - An extension trait which adds utility methods to
AsyncWritetypes.
Functions§
- copy
- Creates a future which copies all the bytes from one object to another.
- copy_
buf - Creates a future which copies all the bytes from one object to another.
- copy_
buf_ abortable - Creates a future which copies all the bytes from one object to another, with its
AbortHandle. - empty
- Constructs a new handle to an empty reader.
- repeat
- Creates an instance of a reader that infinitely repeats one byte.
- sink
- Creates an instance of a writer which will successfully consume all data.