#[non_exhaustive]pub enum Error {
Show 13 variants
BufferTooShort(BufferTooShort),
OutputBufferTooSmall(OutputBufferTooSmall),
BadDataIdentifier(u8),
InvalidSync(InvalidSync),
BadEndOfPesMarker(u8),
UnknownSegmentType(u8),
BadStuffingByte(u8),
SegmentTooLarge,
FieldOverflow(FieldOverflow),
InvalidSubregionCount(usize),
SubregionPositionMismatch,
TrailingEntryBytes {
what: &'static str,
entry_len: usize,
extra: usize,
},
InvalidValue(InvalidValue),
}Expand description
A DVB subtitle parse or serialize error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BufferTooShort(BufferTooShort)
Input shorter than required.
OutputBufferTooSmall(OutputBufferTooSmall)
Output buffer smaller than the serialized form requires.
BadDataIdentifier(u8)
The data_identifier was not the required 0x20.
InvalidSync(InvalidSync)
A fixed marker did not match (sync_byte, expected 0x0F).
BadEndOfPesMarker(u8)
The end_of_PES_data_field_marker was not 0xFF.
UnknownSegmentType(u8)
An unrecognised or invalid segment_type was encountered.
BadStuffingByte(u8)
Stuffing byte was not 0x00.
SegmentTooLarge
Segment length too large for parsed data.
FieldOverflow(FieldOverflow)
A field value did not fit its wire width (#1129/#1044): compared before narrowing, so an over-range value is rejected instead of silently masked/wrapped.
InvalidSubregionCount(usize)
A DisparityRegion had 0 or more than 4 subregions — the wire
number_of_subregions_minus_1 field (Table 29) is 2 bits, so only
1..=4 subregions are representable.
SubregionPositionMismatch
A Subregion’s subregion_horizontal_position/subregion_width
presence didn’t match the region’s subregion count (Table 29: both
are present for every subregion when, and only when, the region has
more than one).
TrailingEntryBytes
A repeating-entry loop (Table 31’s CLUT entry loop; Table 21’s page composition region loop) had leftover bytes that don’t form a whole entry, where the spec’s own loop condition never leaves a remainder.
Fields
InvalidValue(InvalidValue)
A field value does not fit the bits the wire format gives it (e.g. a reduced-range CLUT colour component wider than its 6/4/2-bit slot).
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()