FileLoader

Trait FileLoader 

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

Source

fn canonicalize_path(&self, path: &Path) -> Result<PathBuf>

Source

fn load_stdin(&self) -> Result<String>

Source

fn load_file(&self, path: &Path) -> Result<String>

Source

fn load_binary_file(&self, path: &Path) -> Result<Vec<u8>>

Implementors§