pub trait FileProvider {
// Required method
fn read_bytes<P: AsRef<Path>>(
&self,
path: P,
) -> Result<Cow<'_, [u8]>, Error>;
// Provided method
fn read_str<P: AsRef<Path>>(&self, path: P) -> Result<Cow<'_, str>, Error> { ... }
}
Expand description
A trait for providing file contents.
Required Methods§
Provided Methods§
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.