Expand description
hookfs routes native file-system calls for selected paths to a Rust virtual
filesystem.
It preserves native behavior for paths outside the mounted namespace and uses
plthook to install the Windows, Linux, macOS, and iOS/iPadOS ABI shims. The
public VFS traits and providers are platform-independent; installation reports
an unavailable backend on targets without one.
Re-exports§
pub use vfs::FileStream;pub use vfs::OpenOptions;pub use vfs::VfsDirEntry;pub use vfs::VfsMetadata;pub use vfs::VirtualFs;
Modules§
- vfs
- The virtual-filesystem core: the
FileStreambyte-stream trait, theVirtualFsprovider trait, the metadata/directory value types, and the shared-source machinery that gives every native open an **independent logical
Structs§
- Hookfs
- A mount context: a reserved synthetic directory plus the in-memory tree that
backs it. Mount streams into it, then
installthe hooks. - Install
Guard - RAII owner of an installation. Dropping it restores the original imports (compare-exchange, best-effort) and clears the active routing state.
- Memory
Fs - An in-memory directory tree keyed by normalized absolute path.
- Mount
Guard - Removes a mounted name when dropped. Already-open handles are unaffected.
- Mounted
Path - A single-stream (plus optional siblings) mount, exposing the primary synthetic
path and its own
Hookfscontext. Returned bymount_read_seek. - Options
- Overlay
Fs - A stack of virtual filesystems consulted in order.
Enums§
- Error
- Errors produced while mounting streams or installing the filesystem hooks.
- Scope
- Which modules to patch. The BRAW default is
Scope::Module— the single
Functions§
- install
- Install
hookfsovervfsperopts, returning a guard that restores the original imports when dropped. - mount_
read_ seek - Mount one owned
Read + Seekstream under a reserved synthetic path, returning aMountedPathwhosepathis the logical name to hand to the native library.
Type Aliases§
- Result
- Crate-local result alias.