pub trait VirtualFileSystem {
// Required methods
fn read(&self, path: &Path) -> Result<Vec<u8>>;
fn write_atomic(&self, path: &Path, bytes: &[u8]) -> Result<()>;
fn hash(&self, path: &Path) -> Result<String>;
fn cwd(&self) -> Result<PathBuf>;
fn list_tree(&self, path: &Path) -> Result<Vec<TreeNode>>;
fn recent_file_hashes(&self, limit: usize) -> Result<Vec<FileHash>>;
}Required Methods§
fn read(&self, path: &Path) -> Result<Vec<u8>>
fn write_atomic(&self, path: &Path, bytes: &[u8]) -> Result<()>
fn hash(&self, path: &Path) -> Result<String>
fn cwd(&self) -> Result<PathBuf>
fn list_tree(&self, path: &Path) -> Result<Vec<TreeNode>>
fn recent_file_hashes(&self, limit: usize) -> Result<Vec<FileHash>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".