Expand description
The I/O traits the block and filesystem layers are written against.
With the std feature (the default) every item here is the
corresponding std::io item, re-exported: a BlockDevice is a
std::io::Read + Write + Seek, a file handle is a std::io::Read,
and a hosted consumer never sees this module at all.
Without std the crate is #![no_std], and this module supplies a
compact re-implementation of the same surface — the Read,
Write and Seek traits with their usual provided methods,
SeekFrom, Error / ErrorKind / Result, Cursor,
Take and Empty — with the same names and semantics, so the
filesystem code compiles unchanged in either configuration and an
embedded driver implements the traits it already knows from std.
Structs§
- Cursor
- A
Cursorwraps an in-memory buffer and provides it with aSeekimplementation. - Empty
Emptyignores any data written viaWrite, and will always be empty (returning zero bytes) when read viaRead.- Error
- The error type for I/O operations of the
Read,Write,Seek, and associated traits. - Take
- Reader adapter which limits the bytes read from an underlying reader.
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§
- Read
- The
Readtrait allows for reading bytes from a source. - Seek
- The
Seektrait provides a cursor which can be moved within a stream of bytes. - Write
- A trait for objects which are byte-oriented sinks.
Functions§
- empty
- Creates a value that is always at EOF for reads, and ignores all data written.