Skip to main content

Module storage_driver

Module storage_driver 

Source
Expand description

Cross-platform storage backend abstraction.

Selects the appropriate driver at runtime: Linux + real ZNS NVMe (non-WSL2) → ZnsDriver (zone-append, 8 writers) Windows + Administrator → WinNvmeDriver (DeviceIoControl passthrough) macOS / iOS → MmapApfsDriver (UMA + APFS clonefile) WSL2 / Linux no-hardware / other → MmapDriver (io_uring-backed mmap fallback)

All drivers implement StorageDriver. open_storage(data_dir) returns Box<dyn StorageDriver> — callers never need a #[cfg] ladder.

Structs§

DriverCapabilities
MmapApfsDriver
Extends MmapDriver with Darwin-specific page-management and APFS optimisations:
MmapDriver
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.
NoopFilter
WinNvmeDriver
On Windows, raw NVMe Admin and NVM commands are sent via DeviceIoControl(IOCTL_STORAGE_QUERY_PROPERTY / IOCTL_STORAGE_PROTOCOL_COMMAND) against \\.\PhysicalDriveN. Requires Administrator privileges.
ZnsDriver
Thin overlay over ZnsZoneManager. Data is logically stored via the ZNS zone-append path; a MmapDriver overlay holds small metadata values that don’t need zone-append semantics.

Enums§

DriverKind
NetworkFilterKind
StorageError

Traits§

NetworkFilter
StorageDriver

Functions§

log_startup_diagnostics
Log platform diagnostics at daemon startup. Call once from main or orchestrator::init.
open_network_filter
Open the most capable network filter for this platform. See ebpf_filter.rs for the full platform-specific implementations.
open_storage
Open the best available storage driver for this platform and hardware.
running_under_wsl2
true when running inside WSL2 (a real Linux kernel on Hyper-V).