pub trait FileProvider:
Send
+ Sync
+ Debug {
// Required methods
fn read_file(&self, pb: PathBuf) -> Result<Arc<FileSource>, CompilerError>;
fn transform_paths(
&self,
sources: &[String],
) -> Result<Vec<PathBuf>, CompilerError>;
}Expand description
Provides functions to supply file contents by paths.
Required Methods§
Sourcefn read_file(&self, pb: PathBuf) -> Result<Arc<FileSource>, CompilerError>
fn read_file(&self, pb: PathBuf) -> Result<Arc<FileSource>, CompilerError>
Returns a FileSource containing the file contents referred to by the supplied path.
Sourcefn transform_paths(
&self,
sources: &[String],
) -> Result<Vec<PathBuf>, CompilerError>
fn transform_paths( &self, sources: &[String], ) -> Result<Vec<PathBuf>, CompilerError>
Takes a list of strings and returns a transformed list PathBufs.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".