#[non_exhaustive]pub enum XrefErrorKind {
StartxrefNotFound,
BadStartxrefOffset,
NotAnXrefSection,
BadXrefStream(&'static str),
XrefStreamDecode(FilterError),
EncryptionUnsupported,
BadSubsectionHeader,
BadEntry,
TooManyEntries,
BadTrailer(&'static str),
PrevChainCycle,
Parse(ParseError),
}Expand description
Classification of cross-reference errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
StartxrefNotFound
No startxref keyword found in the trailing scan window.
BadStartxrefOffset
startxref found but not followed by a usable integer offset,
or the offset points outside the file.
NotAnXrefSection
Neither an xref keyword nor an N G obj header at the target
offset — the section cannot be classified at all (§7.5.5 step 3
/ §7.5.8.1).
BadXrefStream(&'static str)
A cross-reference stream (§7.5.8) was located but its
dictionary, /W, /Index or packed data violated §7.5.8.2/
§7.5.8.3. The payload is a static description of which rule.
XrefStreamDecode(FilterError)
The cross-reference stream’s /Filter chain failed to decode
(§7.5.8.2 forbids a Crypt filter here, so this is genuinely a
damaged or unsupported-filter stream).
EncryptionUnsupported
The document is encrypted (§7.6) and its cross-reference machinery could not be read, so rebuild-by-scan would have to find objects in ciphertext.
No longer raised for a merely encrypted document. Since
crate::crypto implements the /Standard handler, an encrypted
file with an intact cross-reference table is loaded and decrypted
(or refused with a specific reason — a named cipher, a named
handler, a password prompt). This variant now means exactly what its
name says in the recovery context: encryption that blocks
recovery, raised by crate::document when
crate::recover::RecoverError::Encrypted comes back.
BadSubsectionHeader
A subsection header line wasn’t first count (two
non-negative integers).
BadEntry
An entry violated the exact 20-byte §7.5.4 format.
TooManyEntries
Total entries exceeded MAX_XREF_ENTRIES (pdfcer guard).
BadTrailer(&'static str)
trailer keyword or its dictionary missing/malformed after a
section’s subsections.
PrevChainCycle
The /Prev chain revisited an offset or exceeded
MAX_XREF_SECTIONS (cycle guard, pdfcer policy).
Parse(ParseError)
Structural parse failure inside the trailer dictionary.
Trait Implementations§
Source§impl Clone for XrefErrorKind
impl Clone for XrefErrorKind
Source§impl Debug for XrefErrorKind
impl Debug for XrefErrorKind
Source§impl Display for XrefErrorKind
impl Display for XrefErrorKind
Source§impl Error for XrefErrorKind
impl Error for XrefErrorKind
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()