Crate io_arrays

source ·
Expand description

Random-access I/O

This crate defines ReadAt, WriteAt, and EditAt traits which define interfaces to random-access or seekable devices, such as normal files, block devices, disk partitions, and memory buffers.

It also defines ArrayReader, ArrayWriter, and ArrayEditor types which implement the above traits and and can be constructed from any file-like type. On Posix-ish platforms, including limited support for WASI, these types just contain a single file descriptor (and implement AsRawFd), plus any resources needed to safely hold the file descriptor live. On Windows, they contain a single file handle (and implement AsRawHandle).





  • A minimal base trait for array I/O. Defines operations common to all kinds of random-access devices that fit the “array” concept, including normal files, block devices, and in-memory buffers.
  • A trait for reading and writing to arrays.
  • A trait for reading from arrays.
  • A trait for writing to arrays.