pub enum ParseError {
Show 14 variants
IoError(Error),
Incomplete,
CodePageNumber(u16),
DisplayStandardCode,
TimeCodeStatus,
DiskFormatCode(String),
CharacterCodeTable,
CumulativeStatus,
WinnowParsingError {
message: String,
},
CodePageEncoding {
codepage: u16,
value: String,
source: ConvertError,
},
SubtitleTextTooLong {
blocks: usize,
},
TooManyTtiBlocks,
SubtitleNumberOverflow,
InvalidFieldValue(String),
}Expand description
Errors from reading, parsing or writing STL data
Variants§
IoError(Error)
Reading or writing a file failed
Incomplete
The input ended too early. Not produced when parsing a complete slice, which gives
ParseError::WinnowParsingError instead.
CodePageNumber(u16)
The Code Page Number (CPN) is not one of the code pages allowed by the spec
DisplayStandardCode
The Display Standard Code (DSC) is not a value defined by the spec
TimeCodeStatus
The Time Code Status (TCS) is not a value defined by the spec
DiskFormatCode(String)
The Disk Format Code (DFC) is neither STL25.01 nor STL30.01
CharacterCodeTable
The Character Code Table (CCT) is not a value defined by the spec
CumulativeStatus
The Cumulative Status (CS) of a TTI block is not a value defined by the spec
WinnowParsingError
The data is not a valid STL file, e.g. an invalid TTI block or trailing data
CodePageEncoding
A text field of the GSI block cannot be encoded with its code page when writing
Fields
source: ConvertErrorThe encoding error
SubtitleTextTooLong
The text of a subtitle needs more TTI blocks than a subtitle can have
TooManyTtiBlocks
Adding a subtitle would make the Total Number of TTI Blocks (TNB) exceed 99 999
SubtitleNumberOverflow
Adding a subtitle would make the Subtitle Number (SN) exceed FFFFh
InvalidFieldValue(String)
A field value is invalid according to the spec, with the message of the
InvalidFieldValue it was converted from
Trait Implementations§
Source§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
Source§impl Error for ParseError
impl Error for ParseError
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()
Source§impl From<Error> for ParseError
impl From<Error> for ParseError
Source§impl<T> From<InvalidFieldValue<T>> for ParseError
Keeps the message but not the value, which can be of different types
impl<T> From<InvalidFieldValue<T>> for ParseError
Keeps the message but not the value, which can be of different types