#[non_exhaustive]pub enum Error {
BufferTooShort {
need: usize,
have: usize,
what: &'static str,
},
CrcMismatch {
computed: u32,
expected: u32,
},
InvalidSyncByte {
found: u8,
},
OutputBufferTooSmall {
need: usize,
have: usize,
},
SectionLengthOverflow {
declared: usize,
available: usize,
},
PayloadTooLarge {
len: usize,
max: usize,
},
FieldOverflow(FieldOverflow),
SectionPayloadLengthMismatch {
section_length: u16,
expected: usize,
actual: usize,
},
}Expand description
Error variants that parsers + builders can return.
Spec references inside #[error(...)] strings quote clauses from
ITU-T H.222.0 (= ISO/IEC 13818-1) where applicable.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BufferTooShort
Input buffer was shorter than the smallest valid encoding for the type.
Fields
CrcMismatch
CRC-32 validation failed for a table section.
Fields
InvalidSyncByte
TS sync byte was not the expected 0x47.
OutputBufferTooSmall
Write buffer passed to serialize_into was smaller than serialized_len().
SectionLengthOverflow
A section_length declared more bytes than the containing buffer could hold.
Fields
PayloadTooLarge
A payload was longer than a single TS packet’s fixed payload capacity
(see OwnedTsPacket::serialize_with_payload, #1129).
FieldOverflow(FieldOverflow)
A length or count field’s value does not fit its wire field
(see broadcast_common::len, #1129).
SectionPayloadLengthMismatch
Section::payload did not match what section_length implies (see
Section::serialize_into, #1074 W5). Serializing a hand-built
Section whose fields disagree used to index past serialized_len()
and panic (or write the CRC over payload bytes) instead of erroring.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
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()