Module mycelium_util::io
source · Expand description
A modified version of the Rust standard library’s std::io module, suitable
for use in Mycelium and other kernels.
The traits and functions here are mostly identical to (and copied from!) the
standard library’s std::io module, with the following differences:
Read::read_to_endandRead::read_to_stringrequire the “alloc” feature flag onmycelium_util(which is enabled by default). Bootloaders & other code which cannot allocate may disable this feature flag.Read::read_vectoredandWrite::write_vectoreddo not exist.- Most of the
BufReadutility functions (lines,split,read_until) require the “alloc” feature BufReaderandBufWriterrequire the “alloc” feature (and are not yet implemented).- The
io::Errortype takes anErrorKindand an optional&'static str, and does not wrap another error. This is because we need to be able to construct I/O errors even when we cannot allocate.
Modules§
- The Mycelium I/O Prelude
Structs§
- An iterator over
u8values of a reader. - Adaptor to chain together two readers.
- A
Cursorwraps an in-memory buffer and provides it with aSeekimplementation. - A reader which is always at EOF.
- A type used to conditionally initialize buffers passed to
Readmethods. - A reader which yields one byte over and over and over and over and over and…
- A writer which will move data into the void.
- Reader adaptor which limits the bytes read from an underlying reader.
Enums§
- A list specifying general categories of I/O error.
- Enumeration of possible methods to seek within an I/O object.
Traits§
- A
BufReadis a type ofReader which has an internal buffer, allowing it to perform extra ways of reading. - The
Readtrait allows for reading bytes from a source. - The
Seektrait provides a cursor which can be moved within a stream of bytes. - A trait for objects which are byte-oriented sinks.
Functions§
- Copies the entire contents of a reader into a writer.
- 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.
Type Aliases§
- A specialized
Resulttype for I/O operations.