pub trait FileLoader {
// Required methods
fn normalize(&self, path: &str, basepath: &str) -> String;
fn load(&self, key: &str) -> ComposeResult<LoadedDoc>;
}Expand description
Loads a normalized file key to its parsed document. load returns
ComposeLoadError(REF_FILE_NOT_FOUND) when the key is absent — the engine
relies on that exact code (an unresolved $ref is a load error, never
valid:true).
Required Methods§
Sourcefn normalize(&self, path: &str, basepath: &str) -> String
fn normalize(&self, path: &str, basepath: &str) -> String
Resolve path against basepath to the canonical key the map uses.
Sourcefn load(&self, key: &str) -> ComposeResult<LoadedDoc>
fn load(&self, key: &str) -> ComposeResult<LoadedDoc>
Load the parsed document at the canonical key, or return NOT_FOUND.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".