pub enum LoadError {
NoSources,
MissingModules(Vec<String>),
DiagnosticThreshold {
report: DiagnosticReport,
},
Source(Box<dyn Error + Send + Sync>),
Io(Error),
}Expand description
Errors returned by Loader::load and the
free function load.
All variants carry enough context for callers to present useful error
messages. The Display implementation produces
human-readable text for each case.
Variants§
NoSources
MissingModules(Vec<String>)
One or more explicitly requested modules were not found after resolution.
The contained Vec lists the missing module names.
DiagnosticThreshold
A diagnostic exceeded the configured fail-at severity threshold.
report contains every diagnostic collected during the load, not
only those at or above the failure threshold. The diagnostics are
ordered by pipeline phase, code, effective severity, module, stable
source identity and label, half-open source range, and message. The
report retains every source document needed to derive locations after
the failed MIB has been dropped.
See DiagnosticConfig for threshold configuration.
Fields
report: DiagnosticReportAll diagnostics and their retained sources from the failed load.
Source(Box<dyn Error + Send + Sync>)
A Source implementation returned a custom error.
Use LoadError::from_source to construct this variant from an
arbitrary error type.
Io(Error)
An I/O error occurred while reading MIB files from disk.
Implementations§
Source§impl LoadError
impl LoadError
Sourcepub fn from_source(err: impl Error + Send + Sync + 'static) -> Self
pub fn from_source(err: impl Error + Send + Sync + 'static) -> Self
Wrap an arbitrary error as a LoadError::Source.
Useful for custom Source implementations that
need to return domain-specific errors through the loading pipeline.
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()