#[non_exhaustive]pub enum Error {
BufferTooShort(BufferTooShort),
CrcMismatch(CrcMismatch),
InvalidSync(InvalidSync),
OutputBufferTooSmall(OutputBufferTooSmall),
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(BufferTooShort)
Input buffer was shorter than the smallest valid encoding for the type.
CrcMismatch(CrcMismatch)
CRC-32 validation failed for a table section.
InvalidSync(InvalidSync)
A fixed marker did not match (TS sync byte, expected 0x47).
OutputBufferTooSmall(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()