#[non_exhaustive]pub enum Error {
BufferTooShort(BufferTooShort),
CrcMismatch(CrcMismatch),
InvalidSync(InvalidSync),
OutputBufferTooSmall(OutputBufferTooSmall),
SectionLengthOverflow {
declared: usize,
available: usize,
},
PayloadTooLarge {
len: usize,
max: usize,
},
ClockOutOfRange(ClockOutOfRange),
FieldOverflow(FieldOverflow),
NoAdaptationField,
NoClockReference {
which: &'static str,
},
AdaptationFieldTooShort {
need: usize,
have: 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).
ClockOutOfRange(ClockOutOfRange)
A PCR or ESCR value did not fit the 27 MHz clock: a base wider than
33 bits, or an extension >= 300 (the 9-bit wire field can carry
300..=511).
FieldOverflow(FieldOverflow)
A length or count field’s value does not fit its wire field
(see broadcast_common::len, #1129).
NoAdaptationField
The packet has no adaptation field, so it has no PCR (and no OPCR) slot to rewrite.
NoClockReference
The adaptation field has no PCR (or OPCR) slot: either it is shorter than the flags byte plus the 6-byte field, or the packet’s own flag byte does not set the corresponding flag.
AdaptationFieldTooShort
The adaptation field is shorter than the field being written into it.
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()