[][src]Crate memofs

Implementation of a virtual filesystem with a configurable backend and file watching.

memofs is currently an unstable minimum viable library. Its primary consumer is Rojo, a build system for Roblox.

Current Features

  • API similar to std::fs
  • Configurable backends
    • StdBackend, which uses std::fs and the notify crate
    • NoopBackend, which always throws errors
    • InMemoryFs, a simple in-memory filesystem useful for testing

Future Features

  • Hash-based hierarchical memoization keys (hence the name)
  • Configurable caching (write-through, write-around, write-back)

Structs

DirEntry

Vfs equivalent to std::fs::DirEntry.

InMemoryFs

In-memory filesystem that can be used as a VFS backend.

Metadata

Vfs equivalent to std::fs::Metadata.

NoopBackend

VfsBackend that returns an error on every operation.

ReadDir

Vfs equivalent to std::fs::ReadDir.

StdBackend

VfsBackend that uses std::fs and the notify crate.

Vfs

A virtual filesystem with a configurable backend.

VfsLock

A locked handle to a Vfs, created by Vfs::lock.

Enums

VfsEvent

Represents an event that a filesystem can raise that might need to be handled.

VfsSnapshot

A slice of a tree of files. Can be loaded into an InMemoryFs.

Traits

IoResultExt

Trait that transforms io::Result<T> into io::Result<Option<T>>.

VfsBackend

Backend that can be used to create a Vfs.