pub struct MmapApfsDriver { /* private fields */ }Expand description
Extends MmapDriver with Darwin-specific page-management and APFS optimisations:
prefetch_hint→madvise(MADV_WILLNEED)— async prefetch via Mach UBCeviction_hint→madvise(MADV_FREE)— cheap release without forced evictflushWAL fd →fcntl(F_NOCACHE, 1)— bypass page cache for sequential WALsnapshot→clonefile(2)— O(1) APFS CoW clone, zero extra disk space
Implementations§
Trait Implementations§
Source§impl StorageDriver for MmapApfsDriver
impl StorageDriver for MmapApfsDriver
Source§fn capabilities(&self) -> DriverCapabilities
fn capabilities(&self) -> DriverCapabilities
Report DriverKind::MmapApfs — free_snapshots on macOS/iOS only, 4 writers.
Source§fn write(&self, key: &str, data: &[u8]) -> Result<(), StorageError>
fn write(&self, key: &str, data: &[u8]) -> Result<(), StorageError>
Delegate to the inner MmapDriver.
Source§fn append(&self, key: &str, data: &[u8]) -> Result<(), StorageError>
fn append(&self, key: &str, data: &[u8]) -> Result<(), StorageError>
Append under F_NOCACHE on macOS so sequential WAL writes bypass the UBC; delegates off-platform.
Source§fn read(&self, key: &str) -> Result<Vec<u8>, StorageError>
fn read(&self, key: &str) -> Result<Vec<u8>, StorageError>
Inner read plus MADV_WILLNEED on the mapped region (macOS) to prefetch the next pages.
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>
Delegate to the inner MmapDriver.
Source§fn delete(&self, key: &str) -> Result<(), StorageError>
fn delete(&self, key: &str) -> Result<(), StorageError>
Issue eviction_hint first, then delegate the delete.
Source§fn snapshot(&self, snapshot_id: &str) -> Result<(), StorageError>
fn snapshot(&self, snapshot_id: &str) -> Result<(), StorageError>
clonefile(2) CoW clone of the root into .snap_<id> on macOS (removes an existing dst first); falls back to a full copy elsewhere.
Source§fn flush(&self) -> Result<(), StorageError>
fn flush(&self) -> Result<(), StorageError>
fcntl(F_FULLFSYNC) on a sentinel file (macOS) to drain the ANS write queue; no-op elsewhere.
Source§fn prefetch_hint(&self, key: &str)
fn prefetch_hint(&self, key: &str)
MADV_WILLNEED on the key’s mapped data (macOS); no-op elsewhere.
Source§fn eviction_hint(&self, key: &str)
fn eviction_hint(&self, key: &str)
MADV_FREE on the key’s mapped data (macOS); no-op elsewhere.
Auto Trait Implementations§
impl Freeze for MmapApfsDriver
impl RefUnwindSafe for MmapApfsDriver
impl Send for MmapApfsDriver
impl Sync for MmapApfsDriver
impl Unpin for MmapApfsDriver
impl UnsafeUnpin for MmapApfsDriver
impl UnwindSafe for MmapApfsDriver
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