pub trait FileSystem {
// Required methods
fn exists(&self, path: &Path) -> bool;
fn read_to_string(&self, path: &Path) -> Result<String>;
}Expand description
Filesystem abstraction so include resolution can be tested without
touching real disk. Implement this for a real filesystem in an embedder;
FakeFileSystem is the in-memory implementation used by this crate’s
own tests.
Required Methods§
Sourcefn read_to_string(&self, path: &Path) -> Result<String>
fn read_to_string(&self, path: &Path) -> Result<String>
Reads the full contents of path as a UTF-8 string.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".