Skip to main content

vfs_kit/
lib.rs

1//! A lightweight, extensible set of virtual file systems (VFS) for Rust.
2//! Provides abstractions over real or pseudo-file systems. Ideal for testing,
3//! isolated sandboxing, custom storage backends, and more.
4//!
5//! ### Overview
6//!
7//! `vfs-kit` allows you to work with filesystem-like structures in Rust without touching the actual disk (unless you want to).
8//! It defines the generic `FsBackend` trait and provides specific implementations, such as `DirFS`, which map to actual directories.
9//!
10//! **Key ideas**:
11//! - **Abstraction**: Work with different types of storage (real directories, memory cards, etc.) through a single API.
12//! - **Safety**: Operations are performed only within the VFS root directory; random access to the host file system is excluded.
13//! - **Testability**: Use in unit tests to simulate filesystems without side effects.
14//! - **Extensibility**: Create your own storages by adding new `FsBackend` implementations.
15//! - **Clarity**: Detailed error messages and up-to-date documentation.
16
17mod core;
18mod vfs;
19
20pub use core::{FsBackend, Result};
21pub use vfs::{DirFS, Entry, EntryType, MapFS};