#[non_exhaustive]pub enum Error {
Show 13 variants
BufferTooShort {
need: usize,
have: usize,
what: &'static str,
},
BadPackStartCode(u32),
BadSystemHeaderStartCode(u32),
BadMapStreamId(u8),
BadCrc {
computed: u32,
stored: u32,
},
BadMarker(&'static str),
BadScrPrefix(u8),
BadStreamIdExtensionPrefix(u8),
ZeroMuxRate,
StuffingLengthTooLarge(u8),
HeaderLengthOverflow {
header_length: usize,
available: usize,
},
MapLengthOverflow {
map_length: usize,
available: usize,
},
Pes(Error),
}Expand description
A Program Stream parse error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
BufferTooShort
Input shorter than required.
Fields
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.
BadCrc
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.
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).
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 dvb-pes.
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more