#[non_exhaustive]pub enum DecoderError {
Truncated {
offset: usize,
needed: usize,
remaining: usize,
},
InvalidValue {
type_name: &'static str,
detail: String,
},
InvalidCount {
count: i32,
},
CountExceedsInput {
count: usize,
remaining: usize,
},
CountMismatch {
type_name: &'static str,
expected: usize,
found: usize,
},
UnknownDiscriminant {
type_name: &'static str,
discriminant: String,
},
InvalidEnumerator {
type_name: &'static str,
value: String,
},
LengthMismatch {
declared: usize,
consumed: usize,
},
TrailingBytes {
count: usize,
},
}Expand description
Reasons why a byte sequence cannot be decoded.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Truncated
The input ends before the value is complete.
Fields
InvalidValue
The octets do not form a legal value of the datatype.
InvalidCount
An element count is negative.
CountExceedsInput
An element count is larger than the number of octets left, so it cannot be honest.
CountMismatch
A value has a different number of elements than its datatype prescribes.
Fields
UnknownDiscriminant
The discriminant of a variant record selects no known alternative.
Fields
InvalidEnumerator
A value is not one of the enumerators of an enumerated datatype.
Fields
LengthMismatch
The alternative of an HLAextendableVariantRecord did not use exactly the announced length.
Fields
TrailingBytes
Octets are left after the value (strict decoding only).
Trait Implementations§
Source§impl Clone for DecoderError
impl Clone for DecoderError
Source§impl Debug for DecoderError
impl Debug for DecoderError
Source§impl Display for DecoderError
impl Display for DecoderError
impl Eq for DecoderError
Source§impl Error for DecoderError
impl Error for DecoderError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<DecoderError> for RtiError
impl From<DecoderError> for RtiError
Source§fn from(error: DecoderError) -> Self
fn from(error: DecoderError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DecoderError
impl PartialEq for DecoderError
impl StructuralPartialEq for DecoderError
Auto Trait Implementations§
impl Forget for DecoderError
impl Freeze for DecoderError
impl Move for DecoderError
impl RefUnwindSafe for DecoderError
impl Send for DecoderError
impl Sync for DecoderErrorwhere
RawVecInner: Sync,
impl Unpin for DecoderError
impl UnsafeUnpin for DecoderError
impl UnwindSafe for DecoderError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more