Skip to main content

Crate hookfs

Crate hookfs 

Source
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 FileStream byte-stream trait, the VirtualFs provider 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 install the hooks.
InstallGuard
RAII owner of an installation. Dropping it restores the original imports (compare-exchange, best-effort) and clears the active routing state.
MemoryFs
An in-memory directory tree keyed by normalized absolute path.
MountGuard
Removes a mounted name when dropped. Already-open handles are unaffected.
MountedPath
A single-stream (plus optional siblings) mount, exposing the primary synthetic path and its own Hookfs context. Returned by mount_read_seek.
Options
OverlayFs
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 hookfs over vfs per opts, returning a guard that restores the original imports when dropped.
mount_read_seek
Mount one owned Read + Seek stream under a reserved synthetic path, returning a MountedPath whose path is the logical name to hand to the native library.

Type Aliases§

Result
Crate-local result alias.