Enum theme_parser::parser::pff2::ParserError
source · pub enum ParserError {
BadMagicBytes,
InsufficientHeaderBytes,
InsufficientLengthBytes {
section: [u8; 4],
},
FromUtf8Error(FromUtf8Error),
InvalidU16Length(usize),
EmptyCharacterIndex,
CharacterIndexNotSortedAscending,
InvalidCodepoint(u32),
}
Expand description
The PFF2 buffer contained invalid data
Variants§
BadMagicBytes
The PFF2 buffer should start with magic bytes.
InsufficientHeaderBytes
Expected to be able to read 4 bytes as the name of the section
InsufficientLengthBytes
Expected to be able to read 4 bytes as a u32 length of the section
FromUtf8Error(FromUtf8Error)
String stored in a section had illegal UTF-8 bytes
InvalidU16Length(usize)
Expected a section 2b long because content is expected to be a u16
EmptyCharacterIndex
The size of the character index section doesnt divide evenly by the size of the individual elements
CharacterIndexNotSortedAscending
The character index section is required to contain codepoints in ascending order (char as u32
)
InvalidCodepoint(u32)
The codepoint for a glyph entry was not valid UTF-8
Trait Implementations§
source§impl Clone for ParserError
impl Clone for ParserError
source§fn clone(&self) -> ParserError
fn clone(&self) -> ParserError
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ParserError
impl Debug for ParserError
source§impl Display for ParserError
impl Display for ParserError
source§impl Error for ParserError
impl Error for ParserError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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()
source§impl From<FromUtf8Error> for ParserError
impl From<FromUtf8Error> for ParserError
source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
Converts to this type from the input type.
source§impl PartialEq for ParserError
impl PartialEq for ParserError
source§fn eq(&self, other: &ParserError) -> bool
fn eq(&self, other: &ParserError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ParserError
impl StructuralEq for ParserError
impl StructuralPartialEq for ParserError
Auto Trait Implementations§
impl RefUnwindSafe for ParserError
impl Send for ParserError
impl Sync for ParserError
impl Unpin for ParserError
impl UnwindSafe for ParserError
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