pub trait Loader: Send + Sync {
// Required method
fn load(&self, name: &str) -> Result<(String, String), LoadError>;
}Expand description
Finds included templates by name. Returns the resolved path and the source.
The engine does its own name handling first (LiquidJS appends
.liquid to a name with no extension; Nunjucks resolves ./ and ../
names against the including template’s path) and calls load with the
result. The loader only maps a name to a file: it tries each of its
roots in order (11ty’s are the includes folder, then the input folder
for Liquid or the project folder for Nunjucks), refuses names that
leave every root, and returns the path it found and the source.
Templates are told apart by that path, so it should be canonical: a
cycle is then found however the name is spelled.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".