futures_util

Module io

Source
Available on crate feature io only.
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§

Structs§

Traits§

  • Read bytes asynchronously.
  • An extension trait which adds utility methods to AsyncBufRead types.
  • Read bytes asynchronously.
  • An extension trait which adds utility methods to AsyncRead types.
  • Seek bytes asynchronously.
  • An extension trait which adds utility methods to AsyncSeek types.
  • Write bytes asynchronously.
  • An extension trait which adds utility methods to AsyncWrite types.

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 its AbortHandle.
  • 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.