Module tokio::io
[−]
[src]
Asynchronous I/O.
This module is the asynchronous version of std::io. Primarily, it
defines two traits, AsyncRead and AsyncWrite, which extend the
Read and Write traits of the standard library.
AsyncRead and AsyncWrite must only be implemented for
non-blocking I/O types that integrate with the futures type system. In
other words, these types must never block the thread, and instead the
current task is notified when the I/O resource is ready.
Utilities functions are provided for working with AsyncRead /
AsyncWrite types. For example, copy asynchronously copies all
data from a source to a destination.
Additionally, Read, Write, Error, ErrorKind, and
Result are re-exported from std::io for ease of use.
Structs
| Copy |
A future which will copy all data from a reader into a writer. |
| Error |
The error type for I/O operations of the |
| Flush |
A future used to fully flush an I/O object. |
| Lines |
Combinator created by the top-level |
| ReadExact |
A future which can be used to easily read exactly enough bytes to fill a buffer. |
| ReadToEnd |
A future which can be used to easily read the entire contents of a stream into a vector. |
| ReadUntil |
A future which can be used to easily read the contents of a stream into a vector until the delimiter is reached. |
| Shutdown |
A future used to fully shutdown an I/O object. |
| WriteAll |
A future used to write the entire contents of some data to a stream. |
Enums
| ErrorKind |
A list specifying general categories of I/O error. |
Traits
| AsyncRead |
Read bytes asynchronously. |
| AsyncWrite |
Writes bytes asynchronously. |
| Read |
The |
| Write |
A trait for objects which are byte-oriented sinks. |
Functions
| copy |
Creates a future which represents copying all the bytes from one object to another. |
| flush |
Creates a future which will entirely flush an I/O object and then yield the object itself. |
| lines |
Creates a new stream from the I/O object given representing the lines of
input that are found on |
| read_exact |
Creates a future which will read exactly enough bytes to fill |
| read_to_end |
Creates a future which will read all the bytes associated with the I/O
object |
| read_until |
Creates a future which will read all the bytes associated with the I/O
object |
| shutdown |
Creates a future which will entirely shutdown an I/O object and then yield the object itself. |
| write_all |
Creates a future that will write the entire contents of the buffer |
Type Definitions
| Result |
A specialized |