Skip to main content

FileSystem

Trait FileSystem 

Source
pub trait FileSystem: Send + Sync {
    // Required methods
    fn list_directory(&self, path: &Path) -> Result<Vec<EntryMetadata>>;
    fn get_metadata(&self, path: &Path) -> Result<EntryMetadata>;
    fn copy_file(&self, from: &Path, to: &Path) -> Result<()>;
    fn create_directory(&self, path: &Path) -> Result<()>;
    fn exists(&self, path: &Path) -> Result<bool>;
    fn set_modified_time(&self, path: &Path, time: SystemTime) -> Result<()>;
}

Required Methods§

Source

fn list_directory(&self, path: &Path) -> Result<Vec<EntryMetadata>>

Source

fn get_metadata(&self, path: &Path) -> Result<EntryMetadata>

Source

fn copy_file(&self, from: &Path, to: &Path) -> Result<()>

Source

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

Source

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

Source

fn set_modified_time(&self, path: &Path, time: SystemTime) -> Result<()>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§