Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

AnyFS Ecosystem

An open standard for pluggable virtual filesystem backends in Rust.


Overview

AnyFS is an open standard for virtual filesystem backends using a Tower-style middleware pattern for composable functionality.

You get:

  • A familiar std::fs-aligned API
  • Composable middleware (limits, logging, security)
  • Choice of storage: memory, SQLite, host filesystem, or custom
  • A developer-first goal: make storage composition easy, safe, and enjoyable

Architecture

┌─────────────────────────────────────────┐
│  FileStorage<B>                         │  ← Ergonomic std::fs-aligned API
├─────────────────────────────────────────┤
│  Middleware (composable):               │
│    Quota<B>                             │  ← Quotas
│    Restrictions<B>                      │  ← Security
│    Tracing<B>                           │  ← Audit
├─────────────────────────────────────────┤
│  Fs                                     │  ← Storage
│  (Memory, SQLite, VRootFs, custom...)   │
└─────────────────────────────────────────┘

Each layer has one job. Compose only what you need.


Two-Crate Structure

CratePurpose
anyfs-backendMinimal contract: Fs trait + types
anyfsBackends + middleware + mounting + ergonomic FileStorage<B>

Note: Mounting (FsFuse + MountHandle) is part of the anyfs crate behind feature flags (fuse, winfsp), not a separate crate.


Quick Example

#![allow(unused)]
fn main() {
use anyfs::{MemoryBackend, QuotaLayer, RestrictionsLayer, FileStorage};

// Layer-based composition
let backend = MemoryBackend::new()
    .layer(QuotaLayer::builder()
        .max_total_size(100 * 1024 * 1024)
        .build())
    .layer(RestrictionsLayer::builder()
        .deny_permissions()
        .build());

let fs = FileStorage::new(backend);

fs.create_dir_all("/data")?;
fs.write("/data/file.txt", b"hello")?;
}

How to Use This Manual

SectionAudiencePurpose
OverviewStakeholdersOne-page understanding
Getting StartedDevelopersPractical examples
Design & ArchitectureContributorsDetailed design
Traits & APIsBackend authorsContract and types
ImplementationImplementersPlan + backend guide

Future Considerations

These are optional extensions that fit the design but are out of scope for initial release:

  • URL-based backend registry and bulk helpers (FsExt/utilities)
  • Async adapter for remote backends
  • Companion shell for interactive exploration
  • Copy-on-write overlay and archive backends (zip/tar)

See Design Overview for the full list and rationale.


Status

ComponentStatus
DesignComplete
ImplementationNot started (mounting roadmap defined)

Authoritative Documents

  1. AGENTS.md (for AI assistants)
  2. src/architecture/design-overview.md
  3. src/architecture/adrs.md