#[non_exhaustive]pub enum Error {
BufferTooShort {
need: usize,
have: usize,
what: &'static str,
},
InvalidPacketType {
found: u8,
},
ReservedBitsViolation {
field: &'static str,
reason: &'static str,
},
OutputBufferTooSmall {
need: usize,
have: usize,
},
PayloadLengthMismatch {
declared_bits: u16,
remaining_bytes: usize,
},
CrcMismatch {
computed: u32,
expected: u32,
},
}Expand description
Error variants that parsers + builders can return.
Spec references inside #[error(...)] strings quote clauses from
ETSI TS 102 773 v1.4.1 where applicable.
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.
BufferTooShort
Input buffer was shorter than the smallest valid encoding for the type.
Fields
InvalidPacketType
packet_type byte is not in Table 1 (0x00..=0x02, 0x10..=0x12, 0x20..=0x21, 0x30..=0x33).
ReservedBitsViolation
A reserved bit was not in the expected state.
OutputBufferTooSmall
Write buffer passed to serialize_into was smaller than serialized_len().
PayloadLengthMismatch
Payload length declared more bits than remaining bytes.
Fields
CrcMismatch
CRC-32 validation failed.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
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<TryFromPrimitiveError<Bandwidth>> for Error
impl From<TryFromPrimitiveError<Bandwidth>> for Error
Source§fn from(_: TryFromPrimitiveError<Bandwidth>) -> Self
fn from(_: TryFromPrimitiveError<Bandwidth>) -> Self
Converts to this type from the input type.
Source§impl From<TryFromPrimitiveError<FrequencySource>> for Error
impl From<TryFromPrimitiveError<FrequencySource>> for Error
Source§fn from(_: TryFromPrimitiveError<FrequencySource>) -> Self
fn from(_: TryFromPrimitiveError<FrequencySource>) -> Self
Converts to this type from the input type.
Source§impl From<TryFromPrimitiveError<PacketType>> for Error
impl From<TryFromPrimitiveError<PacketType>> for Error
Source§fn from(e: TryFromPrimitiveError<PacketType>) -> Self
fn from(e: TryFromPrimitiveError<PacketType>) -> Self
Converts to this type from the input type.
Source§impl From<TryFromPrimitiveError<S1Field>> for Error
impl From<TryFromPrimitiveError<S1Field>> for Error
Source§fn from(_: TryFromPrimitiveError<S1Field>) -> Self
fn from(_: TryFromPrimitiveError<S1Field>) -> Self
Converts to this type from the input type.
Source§impl From<TryFromPrimitiveError<SubpartVariety>> for Error
impl From<TryFromPrimitiveError<SubpartVariety>> for Error
Source§fn from(_: TryFromPrimitiveError<SubpartVariety>) -> Self
fn from(_: TryFromPrimitiveError<SubpartVariety>) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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