DistributedFileSystem

Trait DistributedFileSystem 

Source
pub trait DistributedFileSystem: Send + Sync {
    // Required methods
    fn open_read(&self, path: &Path) -> Result<Box<dyn Read + Send>>;
    fn create_write(&self, path: &Path) -> Result<Box<dyn Write + Send>>;
    fn list_dir(&self, path: &Path) -> Result<Vec<PathBuf>>;
    fn metadata(&self, path: &Path) -> Result<FileMetadata>;
    fn exists(&self, path: &Path) -> bool;
}
Expand description

Distributed file system abstraction

Required Methods§

Source

fn open_read(&self, path: &Path) -> Result<Box<dyn Read + Send>>

Open a file for reading

Source

fn create_write(&self, path: &Path) -> Result<Box<dyn Write + Send>>

Create a file for writing

Source

fn list_dir(&self, path: &Path) -> Result<Vec<PathBuf>>

List files in a directory

Source

fn metadata(&self, path: &Path) -> Result<FileMetadata>

Get file metadata

Source

fn exists(&self, path: &Path) -> bool

Check if path exists

Implementors§