Expand description
Cross-platform APIs for working with files using direct I/O.
Depending on OS, this will use direct I/O, unbuffered, uncaches passthrough file reads/writes, bypassing as much of OS machinery as possible.
NOTE: There are major alignment requirements described here: https://learn.microsoft.com/en-us/windows/win32/fileio/file-buffering#alignment-and-file-access-requirements https://man7.org/linux/man-pages/man2/open.2.html
APIs deliberately only take page-aligned buffers (OwnedPages) or buffers that are as
unaligned in memory as the offset is in the file, so whole pages go to and from disk without
copies and there is no need to handle arbitrarily aligned input. Only partially written pages at
the edges of a write are copied, see DirectIoFile::write_at().
Structs§
- Direct
IoFile - Wrapper data structure for direct/unbuffered/uncached I/O.
- IoBuf
Error - Error of an operation that takes a buffer by value, which is returned back, so that its allocation can be reused
Enums§
- Direct
IoError - Error of a direct I/O operation
Type Aliases§
- Owned
Pages - Owned buffer of pages, which are the unit of direct I/O.
- Shared
Pages - Shared buffer of pages, see
OwnedPages