Expand description
prov’s filesystem port.
prov is generic over where documents live. Rather than depend on any
one concrete backend — std::fs, tokio::fs, or a browser filesystem like
OPFS/IndexedDB — the library asks only for a small async trait that mirrors
the slice of std::fs its scan/traverse engine needs. Integrators
implement ReadStorage over whatever backend they have; the workspace
never learns which one.
This is the classic ports and adapters seam. The trait uses native
async fn (no boxed futures) because Graph is
generic over its backend rather than erased to dyn, so callers keep the
backend’s real future types and their Send-ness. A backend whose futures
are Send composes into multithreaded runtimes unchanged.
The method set mirrors std::fs names exactly so an adapter is mechanical
to write.
Only the read half is here. The write half — Storage, the durability
vocabulary, and the writable StdFs/in-memory adapters — is
prov-store’s fs module, so that depending on this crate cannot get you
the ability to change a workspace.
Structs§
- DirEntry
- One entry returned by
ReadStorage::read_dir. - File
Type - The type of a filesystem entry.
- Metadata
- Metadata about a filesystem entry — the subset prov needs.
- StdFs
ReadStorageover the process filesystem (std::fs).
Traits§
- Read
Storage - The read half of an async filesystem backend: everything the traversal core needs, and nothing that can change a byte on disk.