Module futures_util::io 
source · 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.
Re-exports§
- pub use std::io::Error;
- pub use std::io::ErrorKind;
- pub use std::io::IoSlice;
- pub use std::io::IoSliceMut;
- pub use std::io::Result;
- pub use std::io::SeekFrom;
Structs§
- A simple wrapper type which allows types which implement only implementstd::io::Readorstd::io::Writeto be used in contexts which expect anAsyncReadorAsyncWrite.
- TheBufReaderstruct adds buffering to any reader.
- Wraps a writer and buffers its output.
- Reader for thechainmethod.
- Future for theclosemethod.
- Future for thecopy()function.
- Future for thecopy_buf()function.
- Future for thecopy_buf_abortable()function.
- ACursorwraps an in-memory buffer and provides it with aAsyncSeekimplementation.
- Reader for theempty()function.
- Future for thefill_bufmethod.
- Future for theflushmethod.
- Sink for theinto_sinkmethod.
- Wrap a writer, likeBufWriterdoes, but prioritizes buffering lines
- Stream for thelinesmethod.
- Future for thereadmethod.
- Future for theread_exactmethod.
- The readable half of an object returned fromAsyncRead::split.
- Future for theread_linemethod.
- Future for theread_to_endmethod.
- Future for theread_to_stringmethod.
- Future for theread_untilmethod.
- Future for theread_vectoredmethod.
- Reader for therepeat()function.
- Error indicating aReadHalf<T>andWriteHalf<T>were not two halves of aAsyncRead + AsyncWrite, and thus could not bereunited.
- Future for theBufReader::seek_relativemethod.
- Future for theseekmethod.
- Writer for thesink()function.
- Reader for thetakemethod.
- An owned window around an underlying buffer.
- Future for thewritemethod.
- Future for thewrite_allmethod.
- The writable half of an object returned fromAsyncRead::split.
- Future for thewrite_vectoredmethod.
Traits§
- Read bytes asynchronously.
- An extension trait which adds utility methods toAsyncBufReadtypes.
- Read bytes asynchronously.
- An extension trait which adds utility methods toAsyncReadtypes.
- Seek bytes asynchronously.
- An extension trait which adds utility methods toAsyncSeektypes.
- Write bytes asynchronously.
- An extension trait which adds utility methods toAsyncWritetypes.
Functions§
- Creates a future which copies all the bytes from one object to another.
- Creates a future which copies all the bytes from one object to another.
- Creates a future which copies all the bytes from one object to another, with itsAbortHandle.
- Constructs a new handle to an empty reader.
- Creates an instance of a reader that infinitely repeats one byte.
- Creates an instance of a writer which will successfully consume all data.