Expand description
Validation gates of the image type-state pipeline.
The loader is a three-state automaton. Each state is a distinct private type, and the only way to move between them is the transition function that consumes the previous state by value:
RawBytes --validate_magic_bytes--> VerifiedPngFile
--decode_png-------------> DecodedPng
--validate_no_jpeg_artifacts--> ImageBufferBecause the intermediate states are private to this module and
ImageBuffer::new is pub(crate), no caller can
fabricate a validated image or skip a gate: the ordering is enforced by the
type system rather than by convention.
Structs§
- Image
Geometry - Geometry of a candidate container, read from its header alone.
Enums§
- Validation
Error - Every way the validation pipeline can reject a candidate container image.
Functions§
- load_
and_ validate - Loads a container image from disk and runs it through every validation gate.
- probe_
geometry - Reads the geometry of a container without decoding a single pixel.