#[non_exhaustive]pub enum Error {
Show 18 variants
BufferTooShort(BufferTooShort),
OutputBufferTooSmall(OutputBufferTooSmall),
BadPackStartCode(u32),
BadSystemHeaderStartCode(u32),
BadMapStreamId(u8),
CrcMismatch(CrcMismatch),
BadMarker(&'static str),
BadScrPrefix(u8),
Mpeg1NotSupported,
BadStreamIdExtensionPrefix(u8),
ZeroMuxRate,
StuffingLengthTooLarge(u8),
StuffingLengthMismatch {
declared: u8,
actual: usize,
},
InvalidField(InvalidField),
HeaderLengthOverflow {
header_length: usize,
available: usize,
},
MapLengthOverflow {
map_length: usize,
available: usize,
},
Pes(Error),
FieldOverflow(FieldOverflow),
}Expand description
A Program Stream parse error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BufferTooShort(BufferTooShort)
Input shorter than required.
OutputBufferTooSmall(OutputBufferTooSmall)
Output buffer passed to serialize_into was smaller than
serialized_len().
BadPackStartCode(u32)
pack_start_code was not 0x000001BA.
BadSystemHeaderStartCode(u32)
system_header_start_code was not 0x000001BB.
BadMapStreamId(u8)
map_stream_id was not 0xBC.
CrcMismatch(CrcMismatch)
Invalid PSM CRC_32.
BadMarker(&'static str)
A required marker_bit was not 1.
BadScrPrefix(u8)
The 01 prefix after pack_start_code was not 01.
Mpeg1NotSupported
The pack header carries the ISO/IEC 11172-1 (MPEG-1) '0010' pack
prefix, a different (12-byte, no SCR extension) layout this crate
does not parse — distinct from Self::BadScrPrefix, which means
the bytes are neither a valid MPEG-1 nor MPEG-2 pack header (#1119).
BadStreamIdExtensionPrefix(u8)
system_header stream_id == 0xB7 but the extension form prefix is wrong.
ZeroMuxRate
program_mux_rate is 0 (forbidden).
StuffingLengthTooLarge(u8)
pack_stuffing_length exceeds 7 (3-bit field).
StuffingLengthMismatch
PackHeader::stuffing.len() does not match stuffing_length — the
two are independently-settable public fields (#1119 W8).
InvalidField(InvalidField)
A caller-set field holds a value that would not read back as the same
header (serialize -> parse must be the identity, ISO/IEC 13818-1
Table 2-40 nextbits() == '1' stream-loop condition).
HeaderLengthOverflow
header_length overflows the available buffer.
Fields
MapLengthOverflow
program_stream_map_length overflows the available buffer.
Fields
Pes(Error)
PES packet parse error from mpeg-pes.
FieldOverflow(FieldOverflow)
A length or count field’s value does not fit its wire field
(see broadcast_common::len, #1129).
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()