Skip to main content

Crate vfs_kit

Crate vfs_kit 

Source
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 FsBackend implementations.
  • 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§

EntryType

Traits§

FsBackend
FsBackend defines a common API for all virtual file systems (vfs) in the crate. Some functions here use path as a parameter or return value. In all cases, path will refer to the virtual file system. The exception is the root() function, which returns the path in the host file system.

Type Aliases§

Result