Trait VirtualFs

Source
pub trait VirtualFs {
    // Required methods
    fn read_file(&self, path: &Path) -> Result<String>;
    fn read_dir(&self, path: &Path) -> Result<Vec<PathBuf>>;
    fn is_file(&self, path: &Path) -> bool;
    fn is_dir(&self, path: &Path) -> bool;
    fn canonicalize_path(&self, path: &PathBuf) -> Result<PathBuf>;

    // Provided methods
    fn is_local(&self, path: &str) -> bool { ... }
    fn strip_prefix<'a>(&'a self, path: &'a Path) -> &'a Path { ... }
}

Required Methods§

Source

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

Source

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

Source

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

Source

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

Source

fn canonicalize_path(&self, path: &PathBuf) -> Result<PathBuf>

Provided Methods§

Source

fn is_local(&self, path: &str) -> bool

Source

fn strip_prefix<'a>(&'a self, path: &'a Path) -> &'a Path

Implementors§