pub struct MmapDriver { /* private fields */ }Expand description
File-backed mmap driver. Each key maps to a flat file under root.
Reads are served via memmap2 so the OS page cache provides zero-copy
semantics for large values. Works on every platform without privileges.
Implementations§
Trait Implementations§
Source§impl StorageDriver for MmapDriver
impl StorageDriver for MmapDriver
fn capabilities(&self) -> DriverCapabilities
fn write(&self, key: &str, data: &[u8]) -> Result<(), StorageError>
fn append(&self, key: &str, data: &[u8]) -> Result<(), StorageError>
fn read(&self, key: &str) -> Result<Vec<u8>, StorageError>
fn read_range( &self, key: &str, offset: usize, len: usize, ) -> Result<Vec<u8>, StorageError>
fn delete(&self, key: &str) -> Result<(), StorageError>
Source§fn snapshot(&self, snapshot_id: &str) -> Result<(), StorageError>
fn snapshot(&self, snapshot_id: &str) -> Result<(), StorageError>
Create a point-in-time snapshot named
snapshot_id.
On APFS this calls clonefile(2) and is O(1), zero-cost on disk.fn flush(&self) -> Result<(), StorageError>
fn prefetch_hint(&self, _key: &str)
fn eviction_hint(&self, _key: &str)
fn describe(&self) -> &str
Auto Trait Implementations§
impl Freeze for MmapDriver
impl RefUnwindSafe for MmapDriver
impl Send for MmapDriver
impl Sync for MmapDriver
impl Unpin for MmapDriver
impl UnsafeUnpin for MmapDriver
impl UnwindSafe for MmapDriver
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more