#[non_exhaustive]pub enum LexErrorKind {
UnterminatedString,
UnterminatedHexString,
InvalidHexStringByte(u8),
MalformedNameEscape,
NulInName,
UnexpectedByte(u8),
IntegerOverflow,
TokenTooLong,
StringTooLong,
}Expand description
Classification of lexical errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnterminatedString
EOF inside a literal string before its parentheses balanced, or a REVERSE SOLIDUS as the final byte (§7.3.4.2 leaves the latter undefined; pdfcer errors).
UnterminatedHexString
EOF inside a hexadecimal string before the closing >.
InvalidHexStringByte(u8)
A byte in a hexadecimal string that is neither a hex digit nor white-space (§7.3.4.3; treated as a syntax error per the RAG’s reading).
MalformedNameEscape
# in a name not followed by two hex digits. §7.3.5 defines no
reader behaviour for this; Pass 1 is strict (see module docs’
failure philosophy).
NulInName
#00 in a name — the name definition excludes NUL (“any
characters except null”, §7.3.5).
UnexpectedByte(u8)
A delimiter that cannot begin a token: a lone ) or a > not
followed by another >.
IntegerOverflow
A numeric-looking token whose integer value exceeds i64 — far
outside any legitimate PDF (Annex C writer range is ±2³¹);
refused rather than silently saturated (fail-clean).
TokenTooLong
Regular-character run longer than MAX_TOKEN_LEN (resource
guard, pdfcer policy).
StringTooLong
Decoded string output longer than MAX_STRING_LEN (resource
guard, pdfcer policy).
Trait Implementations§
Source§impl Clone for LexErrorKind
impl Clone for LexErrorKind
Source§impl Debug for LexErrorKind
impl Debug for LexErrorKind
Source§impl Display for LexErrorKind
impl Display for LexErrorKind
impl Eq for LexErrorKind
Source§impl Error for LexErrorKind
impl Error for LexErrorKind
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()