Skip to main content

FileOps

Trait FileOps 

Source
pub trait FileOps {
    // Required methods
    fn rename(&self, from: &Path, to: &Path) -> Result<()>;
    fn hard_link(&self, src: &Path, dst: &Path) -> Result<()>;
    fn remove_file(&self, path: &Path) -> Result<()>;
    fn sync_dir(&self, path: &Path) -> Result<()>;
}
Expand description

Trait abstracting filesystem operations for testability. Production code uses RealFileOps; tests can inject failures.

Required Methods§

Source

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

Source

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

Source

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

Implementors§