Skip to main content

ImportLoader

Trait ImportLoader 

Source
pub trait ImportLoader {
    // Required method
    fn load(&self, path: &str) -> Result<String, String>;
}
Expand description

Trait for loading .fd files by path.

Implemented differently by each host environment:

  • WASM: reads from VS Code workspace via message passing
  • LSP: reads from the filesystem
  • CLI/tests: reads from a HashMap or disk

Required Methods§

Source

fn load(&self, path: &str) -> Result<String, String>

Load the contents of a .fd file at the given path.

Implementors§