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,
},
Truncated,
InvalidCrc {
expected: u32,
computed: 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§
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
Truncated
Input buffer was shorter than required for CRC validation.
InvalidCrc
CRC-32 value did not match expected checksum.
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