Trait FileSystem

Source
pub trait FileSystem {
    // Required methods
    fn canonicalize_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>;
    fn file_content_utf8<P: AsRef<Path>>(
        &self,
        path: P,
    ) -> Result<String, Error>;
}
Expand description

Interface to abstract file system. Normally you want to use ProdFileSystem.

Required Methods§

Source

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

canonicalize the given path.

Source

fn file_content_utf8<P: AsRef<Path>>(&self, path: P) -> Result<String, Error>

Load the given path and returns it as UTF-8 String.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§