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§
Provided Methods§
Sourcefn read_to_string(&mut self, path: &Path) -> Result<String>
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".