pub enum ParseError {
UnexpectedToken {
offset: u64,
expected: String,
found: String,
},
UnexpectedEof {
offset: u64,
},
NumberOutOfRange {
offset: u64,
},
InvalidString {
offset: u64,
detail: String,
},
InvalidName {
offset: u64,
detail: String,
},
InvalidObjectHeader {
offset: u64,
},
MissingEndobj {
offset: u64,
},
DuplicateKey {
key: String,
},
MissingEndstream {
offset: u64,
},
InvalidNumber {
offset: u64,
},
InvalidXrefEntry {
offset: u64,
},
Other {
offset: u64,
message: String,
},
}Expand description
Syntax-level parse error for PDF objects.
These errors represent problems at the PDF syntax level (tokens, object structure, etc.) as opposed to higher-level semantic errors.
Variants§
UnexpectedToken
An unexpected token was encountered.
Fields
UnexpectedEof
An unexpected end of input was reached.
NumberOutOfRange
A numeric value is out of the representable range.
InvalidString
A string literal is malformed (unbalanced parentheses, invalid escape, etc.).
Fields
InvalidName
A name object contains invalid data.
Fields
InvalidObjectHeader
An invalid indirect object header (N G obj).
MissingEndobj
The endobj keyword is missing after an indirect object.
DuplicateKey
A duplicate key was found in a dictionary.
MissingEndstream
The endstream keyword is missing after stream data.
InvalidNumber
A numeric literal is invalid (not a valid integer or real).
InvalidXrefEntry
A cross-reference entry is malformed.
Other
A generic parse error with a descriptive message.
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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
1.30.0 · 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()