Expand description
Transparent and deep recursive decompression inspection for format detection.
Provides bounded stream decompression across all supported compression formats,
enabling inspection of inner payloads, identification of compound formats (e.g. TarGz),
format chains (@chain(f... > f...)), and UNIX file compatibility mode (-z / -Z).
Structs§
- Bounded
Writer - A writer that collects up to
limitbytes into an in-memory buffer, aborting with an error when the limit is exceeded to stop unbounded decompression. - Detection
Source Reader - Wraps a
DetectionSourceto implementstd::io::Readby reading sequentially from offset 0.
Constants§
- DEFAULT_
DECOMPRESS_ BYTE_ LIMIT - Default byte limit (1 MiB) for bounded decompression probes during file inspection.
- DEFAULT_
MAX_ DECOMPRESSION_ DEPTH - Default maximum recursion depth allowed during recursive decompression inspection.
Functions§
- build_
compat_ candidate - Builds a
DetectionCandidateadhering to UNIXfilecompatibility mode conventions. - build_
compound_ candidate - Builds a
DetectionCandidaterepresenting a compound format (e.g.TarGz). - build_
format_ chain_ candidate - Builds a
DetectionCandidaterepresenting an arbitrary format chain (@chain(f_a > f_b > ...)) with layers ordered innermost → outermost. - decompress_
bounded - Decompresses up to
limitbytes fromsourceusing the specified compression format. - format_
chain_ directive - Formats a canonical Document Character format chain directive
@chain(f_a > f_b > ...)for layers ordered innermost → outermost. - format_
chain_ layer_ annotation - Formats a single chain layer as
[fN Ident "label"]for rich rendering. - format_
chain_ pretty - Formats a human-readable pretty-printed format chain description, including format shorthands and full format titles/descriptions, for layers ordered innermost → outermost.
- probe_
decompression_ candidates - Probes a compressed source, decompressing up to the configured limit and recursively identifying the inner payload format.
- resolve_
compound_ format - Resolves an inner and outer format pair to a single compound
FormatIdif one is registered.