FileSystem

Trait FileSystem 

Source
pub trait FileSystem {
    // Required methods
    fn duplicate(&self) -> Box<dyn FileSystem>;
    fn subsystem(&self, path: &Path) -> Box<dyn FileSystem>;
    fn exists(&self, path: &Path) -> bool;
    fn read(
        &self,
        path: &Path,
        f: &mut dyn FnMut(&mut dyn ReadSeek) -> IoResult<()>,
    ) -> IoResult<()>;
    fn write(
        &self,
        path: &Path,
        f: &mut dyn FnMut(&mut dyn Write) -> IoResult<()>,
    ) -> IoResult<()>;
    fn full_path_for(&self, path: &Path) -> PathBuf;
    fn files(&self) -> Vec<PathBuf>;
    fn remove(&self, path: &Path) -> IoResult<()>;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn copy(&self, from: &Path, to: &Path) -> IoResult<()> { ... }
}

Required Methods§

Source

fn duplicate(&self) -> Box<dyn FileSystem>

Source

fn subsystem(&self, path: &Path) -> Box<dyn FileSystem>

Source

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

Source

fn read( &self, path: &Path, f: &mut dyn FnMut(&mut dyn ReadSeek) -> IoResult<()>, ) -> IoResult<()>

Source

fn write( &self, path: &Path, f: &mut dyn FnMut(&mut dyn Write) -> IoResult<()>, ) -> IoResult<()>

Source

fn full_path_for(&self, path: &Path) -> PathBuf

Source

fn files(&self) -> Vec<PathBuf>

Source

fn remove(&self, path: &Path) -> IoResult<()>

Provided Methods§

Source

fn is_empty(&self) -> bool

Source

fn copy(&self, from: &Path, to: &Path) -> IoResult<()>

Implementors§