#[non_exhaustive]pub enum Error {
Show 13 variants
BufferTooShort(BufferTooShort),
CrcMismatch(CrcMismatch),
InvalidSync(InvalidSync),
OutputBufferTooSmall(OutputBufferTooSmall),
#[non_exhaustive] SectionLengthOverflow {
declared: usize,
available: usize,
},
#[non_exhaustive] PayloadTooLarge {
len: usize,
max: usize,
},
ClockOutOfRange(ClockOutOfRange),
FieldOverflow(FieldOverflow),
NoAdaptationField,
#[non_exhaustive] NoClockReference {
which: &'static str,
},
#[non_exhaustive] AdaptationFieldTooShort {
need: usize,
have: usize,
},
#[non_exhaustive] DescriptorHeaderTruncated {
offset: usize,
need: usize,
have: usize,
},
#[non_exhaustive] DescriptorBodyTruncated {
offset: usize,
tag: u8,
declared: 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().
#[non_exhaustive]SectionLengthOverflow
A section_length declared more bytes than the containing buffer could hold.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]PayloadTooLarge
A payload was longer than a single TS packet’s fixed payload capacity
(see OwnedTsPacket::serialize_with_payload, #1129).
Fields
This variant is marked as non-exhaustive
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_core::len, #1129).
NoAdaptationField
The packet has no adaptation field, so it has no PCR (and no OPCR) slot to rewrite.
#[non_exhaustive]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.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]AdaptationFieldTooShort
The adaptation field is shorter than the field being written into it.
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]DescriptorHeaderTruncated
A descriptor loop ends with fewer bytes than a descriptor() header
(ISO/IEC 13818-1 §2.6).
Fields
This variant is marked as non-exhaustive
#[non_exhaustive]DescriptorBodyTruncated
A descriptor declares a descriptor_length that runs past the end of
its loop (ISO/IEC 13818-1 §2.6).
Fields
This variant is marked as non-exhaustive
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()