Skip to main content

Module io

Module io 

Source
Expand description

The reader and writer traits used by the encoder and decoder.

With the std feature (enabled by default), Read and Write are implemented for every std::io::Read and std::io::Write, and Error is std::io::Error — pass std::io types everywhere and this module disappears from view.

Without std, the traits are implemented for byte slices (&[u8] reads from the front, &mut [u8] writes to the front) and, with the alloc feature, for Vec<u8>; Error is a minimal replacement carrying an ErrorKind. Implement the traits directly to read from or write to anything else, such as a peripheral or a network buffer.

Structs§

Error
The error type for I/O operations of the Read, Write, Seek, and associated traits.

Enums§

ErrorKind
A list specifying general categories of I/O error.

Traits§

Read
A source of bytes.
Write
A sink for bytes.