Skip to main content

FileSystem

Trait FileSystem 

Source
pub trait FileSystem {
    // Required method
    fn read(&mut self, path: &Path) -> Result<Vec<u8>>;

    // Provided method
    fn read_to_string(&mut self, path: &Path) -> Result<String> { ... }
}
Expand description

A simple file-system abstraction for FileSource.

Required Methods§

Source

fn read(&mut self, path: &Path) -> Result<Vec<u8>>

Attempt to read the file contents at path.

Provided Methods§

Source

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

Attempt to read the file contents at path into a String.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§