Skip to main content

FileOps

Trait FileOps 

Source
pub trait FileOps {
    // Required methods
    fn path(&self) -> &PathBuf;
    fn remove(&self, path: &PathBuf);
    fn copy(&self, src: &PathBuf, dest: &PathBuf);
}
Expand description

Interface for all file structs to perform common operations

Ensures that all files (file, dir, symlink) have a way of obtaining their path, copying, and deleting

Required Methods§

Source

fn path(&self) -> &PathBuf

Source

fn remove(&self, path: &PathBuf)

Source

fn copy(&self, src: &PathBuf, dest: &PathBuf)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§