Expand description
A lightweight, extensible set of virtual file systems (VFS) for Rust. Provides abstractions over real or pseudo-file systems. Ideal for testing, isolated sandboxing, custom storage backends, and more.
§Overview
vfs-kit allows you to work with filesystem-like structures in Rust without touching the actual disk (unless you want to).
It defines the generic FsBackend trait and provides specific implementations, such as DirFS, which map to actual directories.
Key ideas:
- Abstraction: Work with different types of storage (real directories, memory cards, etc.) through a single API.
- Safety: Operations are performed only within the VFS root directory; random access to the host file system is excluded.
- Testability: Use in unit tests to simulate filesystems without side effects.
- Extensibility: Create your own storages by adding new
FsBackendimplementations. - Clarity: Detailed error messages and up-to-date documentation.
Structs§
- DirFS
- A virtual filesystem (VFS) implementation that maps to a real directory on the host system.
- Entry
- MapFS
- A virtual file system (VFS) implementation that stores file and directory entries in memory using a hierarchical map structure.
Enums§
Traits§
- FsBackend
- FsBackend defines a common API for all virtual file systems (vfs) in the crate.
Some functions here use
pathas a parameter or return value. In all cases,pathwill refer to the virtual file system. The exception is theroot()function, which returns the path in the host file system.