pub struct DirectSwapFile { /* private fields */ }Expand description
2026-09-25: Fixed-stride swap file: record disk_slot at
disk_slot * record_bytes, with record_bytes a non-zero 4 KiB multiple.
A buffer that is not 4 KiB-aligned is staged through an internal aligned bounce,
one extra copy of the record. Residency passes its page-aligned scratch.
An empty swap file does not mean a write failed: Residency writes a record only
when its arena has no free slot. The file then reaches
(highest disk_slot + 1) * record_bytes and never shrinks, since this type keeps
the no-op discard_record default.
Implementations§
Trait Implementations§
Source§impl SwapStore for DirectSwapFile
impl SwapStore for DirectSwapFile
fn record_bytes(&self) -> usize
fn write_record(&mut self, disk_slot: usize, bytes: &[u8]) -> Result<()>
fn read_record(&self, disk_slot: usize, out: &mut [u8]) -> Result<()>
Source§fn discard_record(&mut self, _disk_slot: usize)
fn discard_record(&mut self, _disk_slot: usize)
2026-09-25: Called when
disk_slot is freed. The default does nothing;
Residency reuses the index from its free list either way.Auto Trait Implementations§
impl Freeze for DirectSwapFile
impl RefUnwindSafe for DirectSwapFile
impl Send for DirectSwapFile
impl !Sync for DirectSwapFile
impl Unpin for DirectSwapFile
impl UnwindSafe for DirectSwapFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more