pub trait VortexFs {
// Required methods
fn read_file(&self, path: &str) -> VortexFsResult<Vec<u8>>;
fn write_file(&mut self, path: &str, data: &[u8]) -> VortexFsResult<()>;
fn append_file(&mut self, path: &str, data: &[u8]) -> VortexFsResult<()>;
fn remove_file(&mut self, path: &str) -> VortexFsResult<()>;
fn rename(&mut self, from: &str, to: &str) -> VortexFsResult<()>;
fn create_dir_all(&mut self, path: &str) -> VortexFsResult<()>;
fn remove_dir(&mut self, path: &str) -> VortexFsResult<()>;
fn read_dir(&self, path: &str) -> VortexFsResult<Vec<String>>;
fn metadata(&self, path: &str) -> VortexFsResult<FileMetadata>;
fn exists(&self, path: &str) -> bool;
fn fsync(&mut self, path: &str) -> VortexFsResult<()>;
}Expand description
Required Methods§
Sourcefn write_file(&mut self, path: &str, data: &[u8]) -> VortexFsResult<()>
fn write_file(&mut self, path: &str, data: &[u8]) -> VortexFsResult<()>
Write data to a file (creates or overwrites).
Sourcefn append_file(&mut self, path: &str, data: &[u8]) -> VortexFsResult<()>
fn append_file(&mut self, path: &str, data: &[u8]) -> VortexFsResult<()>
Append data to a file (creates if not exists).
Sourcefn remove_file(&mut self, path: &str) -> VortexFsResult<()>
fn remove_file(&mut self, path: &str) -> VortexFsResult<()>
Remove a file.
Sourcefn create_dir_all(&mut self, path: &str) -> VortexFsResult<()>
fn create_dir_all(&mut self, path: &str) -> VortexFsResult<()>
Create a directory (and all parent directories).
Sourcefn remove_dir(&mut self, path: &str) -> VortexFsResult<()>
fn remove_dir(&mut self, path: &str) -> VortexFsResult<()>
Remove an empty directory.
Sourcefn metadata(&self, path: &str) -> VortexFsResult<FileMetadata>
fn metadata(&self, path: &str) -> VortexFsResult<FileMetadata>
Get metadata about a file or directory.
Sourcefn fsync(&mut self, path: &str) -> VortexFsResult<()>
fn fsync(&mut self, path: &str) -> VortexFsResult<()>
Flush / fsync a file (no-op for in-memory, real sync for production).