#[non_exhaustive]pub enum DecodeError {
Show 15 variants
Bits {
parameter: String,
source: BitError,
},
NoSuchContainer {
name: String,
},
AmbiguousRoot {
candidates: usize,
},
UnrecognizedPacket {
container: String,
candidates: Vec<String>,
},
AmbiguousPacket {
container: String,
candidates: Vec<String>,
},
ParameterNotYetDecoded {
context: &'static str,
parameter: String,
},
IncomparableValue {
parameter: String,
value_kind: &'static str,
literal: String,
},
InvalidText {
parameter: String,
charset: &'static str,
bytes: usize,
},
UnterminatedString {
parameter: String,
bytes: usize,
},
UnknownEnumeration {
parameter: String,
value: i128,
},
Calibration {
parameter: String,
reason: String,
},
BadFieldSize {
parameter: String,
bits: i64,
},
NoDiscreteLookupMatch {
parameter: String,
},
Unsupported {
element: String,
context: String,
},
DanglingIndex {
what: &'static str,
},
}Expand description
Anything that can go wrong decoding a packet.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bits
A field extends past the end of the packet.
Fields
NoSuchContainer
The named root container does not exist in the database.
AmbiguousRoot
The database offers no unambiguous root container and none was named.
UnrecognizedPacket
Decoding reached an abstract container whose inheritors all failed their criteria.
This is the reference implementation’s UnrecognizedPacketTypeError: the packet is
of a type the definition does not describe.
Fields
AmbiguousPacket
More than one inheritor matched, so the packet type is ambiguous.
Fields
ParameterNotYetDecoded
A criterion or dynamic size referenced a parameter that has not been decoded yet.
XTCE references are positional: a field can only depend on a field that precedes it.
Fields
IncomparableValue
A comparison’s literal cannot be interpreted as the type of the value it is compared against.
Fields
InvalidText
The bytes are not valid text in the declared character set.
Fields
UnterminatedString
A string declares a termination character that does not occur in its buffer.
Fields
UnknownEnumeration
A raw value is outside an enumeration’s defined values.
Fields
Calibration
A calibrator rejected its input.
BadFieldSize
A dynamic size resolved to something unusable.
NoDiscreteLookupMatch
A DiscreteLookupList had no matching entry.
Unsupported
The definition uses a construct this crate models but cannot decode.
This is the promise SUPPORTED.md makes: out-of-scope constructs load without
complaint and fail here, at the exact point a value depends on them.
Fields
DanglingIndex
The database is internally inconsistent — an index does not resolve.
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
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()