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§
Source§impl MmapDriver
impl MmapDriver
Sourcepub fn lookup_range_sources(
&self,
scope: &RecoveryRootScope<'_>,
attempt: [u8; 32],
limits: LookupLimits,
out: &mut [Option<StagingLocator>],
) -> Result<LookupReport, RecoveryError>
pub fn lookup_range_sources( &self, scope: &RecoveryRootScope<'_>, attempt: [u8; 32], limits: LookupLimits, out: &mut [Option<StagingLocator>], ) -> Result<LookupReport, RecoveryError>
Cold bounded local discovery only. Counters bound high-level filesystem steps (bounded helpers), not exact OS-internal syscalls. No incoming path is accepted.
Source§impl MmapDriver
impl MmapDriver
Sourcepub fn create_range_staging<'driver, 'root>(
&'driver self,
charge: StagingCharge<'root>,
limits: RangeLimits,
) -> Result<RangeSession<'driver, 'root>, RangeCreateError<'root>>
pub fn create_range_staging<'driver, 'root>( &'driver self, charge: StagingCharge<'root>, limits: RangeLimits, ) -> Result<RangeSession<'driver, 'root>, RangeCreateError<'root>>
Cold bounded construction under the existing driver/quota root. The charge is consumed even if preflight, creation or cleanup fails. No filesystem mutation is performed until limits and root match.
Trait Implementations§
Source§impl StorageDriver for MmapDriver
impl StorageDriver for MmapDriver
Source§fn capabilities(&self) -> DriverCapabilities
fn capabilities(&self) -> DriverCapabilities
Report DriverKind::Mmap — no zone-append, no free snapshots, single writer.
Source§fn write(&self, key: &str, data: &[u8]) -> Result<(), StorageError>
fn write(&self, key: &str, data: &[u8]) -> Result<(), StorageError>
Write data as a flat file under the root.
Source§fn append(&self, key: &str, data: &[u8]) -> Result<(), StorageError>
fn append(&self, key: &str, data: &[u8]) -> Result<(), StorageError>
Append data via OpenOptions (create if absent).
Source§fn read(&self, key: &str) -> Result<Vec<u8>, StorageError>
fn read(&self, key: &str) -> Result<Vec<u8>, StorageError>
Read via memmap2 — NotFound when absent, empty Vec for a zero-length file.
Source§fn read_range(
&self,
key: &str,
offset: usize,
len: usize,
) -> Result<Vec<u8>, StorageError>
fn read_range( &self, key: &str, offset: usize, len: usize, ) -> Result<Vec<u8>, StorageError>
Read the full value then slice [offset, offset+len) clamped at end.
Source§fn delete(&self, key: &str) -> Result<(), StorageError>
fn delete(&self, key: &str) -> Result<(), StorageError>
Remove the key’s file; idempotent on absent keys.
Source§fn snapshot(&self, snapshot_id: &str) -> Result<(), StorageError>
fn snapshot(&self, snapshot_id: &str) -> Result<(), StorageError>
Copy every file under the root into .snap_<id> (no CoW — full copy).
Source§fn prefetch_hint(&self, _key: &str)
fn prefetch_hint(&self, _key: &str)
No-op — the OS page cache handles prefetch.
Source§fn eviction_hint(&self, _key: &str)
fn eviction_hint(&self, _key: &str)
No-op — the OS page cache handles eviction.
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>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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