pub enum Error {
BufferTooShort {
need: usize,
have: usize,
what: &'static str,
},
CrcMismatch {
computed: u32,
expected: u32,
},
UnexpectedTableId {
table_id: u8,
what: &'static str,
expected: &'static [u8],
},
InvalidDescriptor {
tag: u8,
reason: &'static str,
},
InvalidBcd {
field: &'static str,
bytes: [u8; 4],
},
SectionLengthOverflow {
declared: usize,
available: usize,
},
ReservedBitsViolation {
field: &'static str,
reason: &'static str,
},
OutputBufferTooSmall {
need: usize,
have: usize,
},
InvalidSyncByte {
found: u8,
},
}Expand description
Error variants that parsers + builders can return.
Spec references inside #[error(...)] strings quote clauses from
ETSI EN 300 468 v1.19.1 where applicable.
Variants§
BufferTooShort
Input buffer was shorter than the smallest valid encoding for the type.
Fields
CrcMismatch
CRC-32 validation failed for a table section.
Fields
UnexpectedTableId
table_id byte doesn’t match any expected value for the parser invoked.
Fields
InvalidDescriptor
Descriptor payload failed semantic validation.
InvalidBcd
BCD-encoded value is out of valid range.
Fields
SectionLengthOverflow
A section_length declared more bytes than the containing buffer could hold.
Fields
ReservedBitsViolation
A reserved bit was not in the expected state. Most parsers are permissive about reserved bits; this variant is only emitted when a spec clause specifically requires a value.
OutputBufferTooSmall
Write buffer passed to serialize_into was smaller than serialized_len().
InvalidSyncByte
TS sync byte was not the expected 0x47.
Trait Implementations§
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()