read_write_at 0.1.0

Abstraction over a file or block device that can be read/written with offset.
Documentation
  • Coverage
  • 100%
    17 out of 17 items documented2 out of 16 items with examples
  • Size
  • Source code size: 21.28 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 507.14 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • vi/read_write_at
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • vi

read_write_at

Abstraction of a file- or block derive-like object, data from/to which can be read/written at offsets.

There are alreay some analogues of those traits, including in libstd. But they are either platform-specific or tied to implementation of some algorithm.

This crate focuses on the abstraction itself, providing mostly wrappers and helper functions.

Traits are given in two varieties: with mutable &mut self and immutable &self methods.

libstd's platform-specific FileExt traits are forwarded for std::fs::File.

There is a generic wrapper for using Read+Seek or Read+Write+Seek objects

Immutable version of traits are implemented for RefCells or Mutexs over mutable versions. You may need to use DerefWrapper it you use trait ojects although.

TODO:

  • vectored IO
  • async?
  • reading to uninitialized buffers?
  • bytes crate intergration?

License: MIT/Apache-2.0