Skip to main content

FileLoader

Trait FileLoader 

Source
pub trait FileLoader:
    Send
    + Sync
    + 'static {
    // Required methods
    fn canonicalize_path(&self, path: &Path) -> Result<PathBuf, Error>;
    fn load_stdin(&self) -> Result<String, Error>;
    fn load_file(&self, path: &Path) -> Result<String, Error>;
    fn load_binary_file(&self, path: &Path) -> Result<Vec<u8>, Error>;
}
Expand description

Abstraction over IO operations.

This is called by the file resolver and source map to access the file system.

The default implementation uses std::fs.

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§