Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
fsqlite-vfs
Virtual filesystem abstraction layer for the fsqlite storage engine. This crate defines the traits and implementations that isolate all file I/O behind a pluggable interface, mirroring SQLite's sqlite3_vfs architecture.
Overview
fsqlite-vfs is the lowest layer in the fsqlite storage stack. Every byte that reaches disk (or memory, or io_uring) passes through the Vfs and VfsFile traits defined here. The pager, WAL, and all higher layers depend on this crate but never call std::fs directly -- an ambient-authority audit gate enforces this boundary.
Position in the dependency graph:
fsqlite-types, fsqlite-error
|
fsqlite-vfs <-- you are here
|
fsqlite-pager
/ \
fsqlite-wal fsqlite-btree
\ /
fsqlite-mvcc
Key Types
Vfs(trait) -- A virtual filesystem implementation. Providesopen,delete,access,full_pathname,randomness, andcurrent_time. Generic over its associatedFiletype.VfsFile(trait) -- A file handle opened by a VFS. Supportsread,write,truncate,sync,file_size, five-level locking (lock/unlock/check_reserved_lock), and shared-memory operations (shm_map,shm_lock,shm_barrier,shm_unmap) required for WAL mode.UnixVfs/UnixFile-- Production VFS for Unix systems using POSIX file I/O andfcntllocking.IoUringVfs/IoUringFile-- Linux-only VFS backed byio_uringfor asynchronous I/O.WindowsVfs/WindowsFile-- Windows VFS using native file APIs and advisory locks.MemoryVfs/MemoryFile-- Fully in-memory VFS for testing. No disk I/O.ShmRegion-- Safe handle for shared-memory regions with bounds-checked accessors.TracingFile/VfsMetrics/GLOBAL_VFS_METRICS-- Instrumentation wrapper that records read/write/sync counts and latencies.host_fs(module) -- Audited helpers (read,write,create_dir_all, etc.) that are the only code permitted to callstd::fsoutside of VFS implementations.
On Linux, the shared io_uring driver requires synchronous cancellation support
(Linux 6.0 or newer) so failed operations cannot release buffers that the kernel
still uses. The runtime probes this capability when opening the ring. If the
kernel or host policy does not support it, data I/O uses the existing Unix
fallback. IoUringVfs::status_snapshot() reports availability and the reason.
Usage
use ;
use Cx;
use VfsOpenFlags;
async
Dependencies
fsqlite-types-- Shared type definitions (LockLevel,VfsOpenFlags,SyncFlags,Cx).fsqlite-error-- Unified error/result types.nix,libc-- POSIX syscall bindings (Unix builds).asupersync-- structured async I/O and blocking-pool integration.advisory-lock-- File locking (Windows builds).
License
MIT