Trait rem_utils::location::FileSystem

source ·
pub trait FileSystem: Clone {
    type FSError: Debug;

    // Required methods
    fn exists<P: AsRef<Path>>(&self, path: P) -> Result<bool, Self::FSError>;
    fn read<P: AsRef<Path>>(&self, filename: P) -> Result<String, Self::FSError>;
    fn write<P: AsRef<Path>, C: AsRef<[u8]>>(
        &self,
        filename: P,
        contents: C,
    ) -> Result<(), Self::FSError>;
}
Expand description

Trait representing a file system abstraction

Required Associated Types§

Required Methods§

source

fn exists<P: AsRef<Path>>(&self, path: P) -> Result<bool, Self::FSError>

source

fn read<P: AsRef<Path>>(&self, filename: P) -> Result<String, Self::FSError>

source

fn write<P: AsRef<Path>, C: AsRef<[u8]>>( &self, filename: P, contents: C, ) -> Result<(), Self::FSError>

Object Safety§

This trait is not object safe.

Implementors§