Skip to main content

Module io

Module io 

Source
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 Cursor wraps an in-memory buffer and provides it with a Seek implementation.
Empty
Empty ignores any data written via Write, and will always be empty (returning zero bytes) when read via Read.
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§

ErrorKind
A list specifying general categories of I/O error.
SeekFrom
Enumeration of possible methods to seek within an I/O object.

Traits§

Read
The Read trait allows for reading bytes from a source.
Seek
The Seek trait 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.

Type Aliases§

Result
A specialized Result type for I/O operations.