pub trait ImportLoader {
// Required method
fn load(&self, path: &str) -> Result<String, String>;
// Provided method
fn canonicalize(&self, path: &str) -> 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§
Provided Methods§
Sourcefn canonicalize(&self, path: &str) -> String
fn canonicalize(&self, path: &str) -> String
Return a canonical form of the path for dedup comparison. Default: returns the path unchanged.