Expand description
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?
bytescrate intergration?
Structs§
- Deref
Wrapper - A wrapper struct to allow accessing
RefCellandMutexhelper impls for trait objects. - Read
Write Seek - A wrapper that calls
Seek::seekandRead::readorWrite::writefor each call ofread_atorwrite_atCan be used for read-only access as well.
Traits§
- ReadAt
- Read-only generalisation of
std::os::unix::fs::FileExt - Read
AtMut - Similar to
ReadAt, but functions may allow to change object state, including cursor moves if the object has concept of a cursor - Read
Write At - A combined ReadAt and WriteAt for trait objects.
- Read
Write AtMut - A combined ReadAtMut and WriteAtMut for trait objects
- WriteAt
- Write counterpart of
ReadAt. - Write
AtMut - Similar to
WriteAt, but functions may allow to change object state, including cursor moves if the object has concept of a cursor.