pub struct MemDriver { /* private fields */ }Expand description
In-memory storage driver backed by a growable byte pool buffer.
Uses BytePool::default() for memory management
with byte budget enforcement. Data is never evicted —
valid_window() returns None.
path() returns None.
Trait Implementations§
Source§impl Driver for MemDriver
impl Driver for MemDriver
Source§type Options = MemOptions
type Options = MemOptions
Configuration needed to open/create a driver instance.
Source§fn open(opts: MemOptions) -> StorageResult<(Self, DriverState)>
fn open(opts: MemOptions) -> StorageResult<(Self, DriverState)>
Open or create a new driver from options. Read more
Source§impl DriverIo for MemDriver
impl DriverIo for MemDriver
Source§fn commit(&self, _final_len: Option<u64>) -> StorageResult<()>
fn commit(&self, _final_len: Option<u64>) -> StorageResult<()>
Finalize backing store (e.g. mmap: resize + reopen read-only; memory: truncate). Read more
Source§fn reactivate(&self) -> StorageResult<()>
fn reactivate(&self) -> StorageResult<()>
Reopen for writing (e.g. mmap: reopen as read-write; memory: no-op). Read more
Source§fn read_at(
&self,
offset: u64,
buf: &mut [u8],
_effective_len: u64,
) -> StorageResult<usize>
fn read_at( &self, offset: u64, buf: &mut [u8], _effective_len: u64, ) -> StorageResult<usize>
Read bytes at offset into
buf. Read moreSource§fn storage_len(&self) -> u64
fn storage_len(&self) -> u64
Physical storage length (for
read_at clamping).Source§fn write_at(
&self,
offset: u64,
data: &[u8],
committed: bool,
) -> StorageResult<()>
fn write_at( &self, offset: u64, data: &[u8], committed: bool, ) -> StorageResult<()>
Write bytes at offset. Read more
Source§fn notify_write(&self, _range: &Range<u64>)
fn notify_write(&self, _range: &Range<u64>)
Publish a write range to the fast-path mechanism. Read more
Auto Trait Implementations§
impl !Freeze for MemDriver
impl !RefUnwindSafe for MemDriver
impl Send for MemDriver
impl Sync for MemDriver
impl Unpin for MemDriver
impl UnsafeUnpin for MemDriver
impl !UnwindSafe for MemDriver
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