Expand description
Abstract filesystem trait and the default OS-backed implementation.
All I/O in this crate goes through Fs rather than std::fs / tokio::fs directly.
This makes it possible to swap in an in-memory implementation for:
- Unit tests — avoid touching the real disk.
- WASM / LSP clients — provide file content from the editor’s in-memory document model instead of reading from disk, so the server sees unsaved changes immediately.
The default OsFs implementation (enabled by the tokio feature) delegates to
tokio::fs and is suitable for a native language server process.
All paths are represented as url::Url with the file:// scheme. Directory URLs
always end with a trailing / so that Url::join appends correctly.
Structs§
- FsDir
Entry - Entry returned by
Fs::read_dir. - OsFs
- Standard filesystem implementation using
tokio::fs.
Traits§
- Fs
- Abstract filesystem trait. Implement this to provide a custom backend (e.g., in-memory for WASM, or virtual for testing).