#[non_exhaustive]pub enum XtceError {
Io {
path: PathBuf,
source: Error,
},
Parse(ParseError),
NotXtce {
found: String,
},
Missing {
what: &'static str,
path: String,
},
Invalid {
what: &'static str,
value: String,
path: String,
reason: String,
},
UnresolvedReference {
kind: RefKind,
reference: String,
path: String,
},
DuplicateDefinition {
kind: RefKind,
name: String,
path: String,
},
InheritanceCycle {
chain: Vec<String>,
},
Unsupported {
element: String,
path: String,
},
ArrayNotExpanded {
reason: String,
path: String,
},
}Expand description
Anything that can go wrong turning an XTCE document into an crate::XtceDb.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io
The file could not be read.
Parse(ParseError)
The document is not well-formed XML.
NotXtce
The document is well-formed but not an XTCE SpaceSystem.
Missing
A required element or attribute is absent.
Fields
Invalid
A value is present but cannot be interpreted.
Fields
UnresolvedReference
A name reference does not resolve to a definition.
Fields
DuplicateDefinition
Two definitions share a name in a namespace that requires uniqueness.
Fields
InheritanceCycle
Container inheritance forms a cycle.
Detected during resolution rather than during decoding, so a malformed database fails at load time instead of overflowing the stack on the first packet.
Unsupported
An XTCE construct outside this crate’s declared scope.
This is only raised for constructs that cannot be represented. Constructs that can
be represented but not decoded are recorded in the IR instead and reported by
crate::XtceDb::unsupported, so loading a real mission database never fails just
because part of it is out of scope.
Fields
ArrayNotExpanded
An array entry could not be turned into one parameter per element.
Loading fails rather than the array being dropped: an entry that does not expand leaves every field after it at the wrong offset, and a container decoded at the wrong offsets is worse than one that refuses.
Trait Implementations§
Source§impl Error for XtceError
impl Error for XtceError
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()