pub trait Loader {
// Required method
fn load(&self, name: &str) -> Result<Vec<(String, String)>, String>;
}Expand description
Supplies the source of a named bidama.
One method, because resolution needs exactly one thing: given a name, the blue source that name refers to. Where it came from — a working tree, a nix store path, a git object, memory — is the implementation’s business and deliberately invisible here.
Required Methods§
Sourcefn load(&self, name: &str) -> Result<Vec<(String, String)>, String>
fn load(&self, name: &str) -> Result<Vec<(String, String)>, String>
The .b sources of name, as (label, source) pairs.
The label is for diagnostics only; nothing keys on it. A package with
several files returns several pairs, and their relative order is the
implementation’s to fix — FsLoader
sorts by filename so a load is reproducible rather than
directory-order-dependent.
Err is a human-readable reason the package could not be loaded. It
must name what was looked for, because “package not found” without a
name sends the reader grepping a distribution to find which one.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".