Trait FileSystem

Source
pub trait FileSystem {
    type Error: Error + 'static;

    // Required methods
    fn canonicalize(&self, path: &Path) -> Result<PathBuf, Self::Error>;
    fn exists(&self, path: &Path) -> bool;
    fn read(&self, path: &Path) -> Result<Cow<'_, str>, Self::Error>;
}

Required Associated Types§

Source

type Error: Error + 'static

Required Methods§

Source

fn canonicalize(&self, path: &Path) -> Result<PathBuf, Self::Error>

Source

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

Source

fn read(&self, path: &Path) -> Result<Cow<'_, str>, Self::Error>

Implementors§