Expand description
Thread-local decode-leniency event collector.
Inner parser and filter code calls [emit] to record a recovery or
leniency event without changing any behaviour. A caller that wants to
observe events wraps its work with activate / drain:
ⓘ
pdf_syntax::leniency::activate();
let pdf = Pdf::new(bytes)?; // events accumulate here
let events = pdf_syntax::leniency::drain(); // returns them and resetsWhen no collector is active every [emit] call is a no-op — zero heap
allocation on the hot path. Per-code deduplication prevents a single
corrupt stream from producing thousands of identical events.
Structs§
- Leniency
Event - A single decode-leniency or structural-recovery event.
Enums§
- Leniency
Severity - Severity of a
LeniencyEvent.
Constants§
- ASCI
I85_ LENIENT_ PARTIAL - ASCII-85: a 1-character terminal group was accepted leniently.
- CCITT_
PARTIAL_ DECODE - CCITT: partial row decode — at least one row decoded before an error.
- FLATE_
BAD_ BLOCK - A bad block header was encountered inside a flate stream.
- FLATE_
BROKEN_ FALLBACK - Flate stream broken; decoded with a pure-Rust fallback.
- INDIRECT_
CYCLE - A cycle was detected in indirect object references.
- INDIRECT_
DEPTH_ EXCEEDED - Indirect object resolution depth exceeded the 512-level limit.
- LZW_
INVALID_ CODE - An invalid code was encountered in an LZW stream.
- LZW_
PREMATURE_ EOF - Premature EOF in an LZW stream; the EOD code was absent.
- STREAM_
PARSE_ FALLBACK - Stream parse failed; a manual fallback parser was used.