pub enum LoadError {
Io(Error),
Discover(DiscoverError),
Config {
path: String,
source: Box<ConfigError>,
},
ConfigRead {
path: String,
source: Error,
},
InvalidSourceKey(String),
}Expand description
A failure producing an Environment from a mount.
Variants§
Io(Error)
An I/O error reading or enumerating the tree.
Discover(DiscoverError)
INCLUDE discovery failed (missing include, circular include).
Config
A discovered brink.toml could not be parsed (malformed TOML, or a
recognized key with an out-of-range value). Unknown keys are warnings,
never this error. Carries the discovered path so the message names
which file failed — lost when this variant went through a bare
#[from] ConfigError in #1306 (#1369 restores it). source is
itself now path-carrying too (#1384: parse_str_at threads path
into every ConfigError it raises), so this field is kept for
structural/pattern-matching access (existing callers destructure
LoadError::Config { path, .. }) rather than duplicated into the
rendered message — source’s own Display already names the file.
source is boxed: ConfigError grew past clippy::result_large_err’s
threshold once #1384 threaded path into its own variants, and this
is the one LoadError variant that stacks a second path field on
top of it.
Fields
source: Box<ConfigError>ConfigRead
A discovered brink.toml could not be read (permission error,
non-UTF-8 bytes, or any other I/O failure) — the other half of
#1369’s regression: tree.read(&config_key)? used to fall through
the bare #[from] io::Error on LoadError::Io, which carries no
path (RealFs::read is fs::read_to_string, and std I/O errors
don’t carry the path that failed). Carries the discovered path so
this half names the file too.
InvalidSourceKey(String)
A native source key is not root-relative (contains a .. segment) — a
save-key-identity guardrail against a SourceTree that violates the
contract.
Trait Implementations§
Source§impl Error for LoadError
impl Error for LoadError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()