Expand description
Core specifications and correctness/security theorems for Vest combinators.
This module forms the foundation of the Vest combinator framework. It defines:
§spec — Specification Family of Traits
spec::SpecParser— parser specificationspec::SpecSerializer— serializer specificationspec::Consistency— value well-formedness against the format specificationspec::SpecByteLen— byte length of serialized valuesspec::SpecSerializerDps— destination-passing style serializer specification for better composabilityspec::StaticByteLen— fixed byte length for static-size formats
These traits are designed to be as independent as possible such that they can be useful individually
(e.g., applications that only need to specify parsing but not serialization, or vice versa). However,
Vest combinators generally provide trait implementations for all of these traits, and the proofs
in the proof module often rely on multiple, if not all, of these traits being implemented
for the combinators in question.
§proof — Proof Family of Traits
proof::SPRoundTrip— serialize-parse roundtripproof::SPRoundTripDps— serialize-parse roundtrip (the DPS variant, used mostly internally), which also carries the unambiguity side condition needed by roundtrip proofsproof::PSRoundTrip— parse-serialize roundtripproof::NonMalleable— parser non-malleabilityproof::NoLookAhead— parser no-look-ahead propertyproof::Productive— parser productivityproof::NonAmbiguous— serializer non-ambiguityproof::EquivSerializers/proof::EquivSerializersGeneral— DPS ↔ non-DPS equivalence
Following the same philosophy as the specification traits, these proof traits are defined on top of
a minimal set of specification traits, and crucially, they are not defined/dependent on each other.
This way, combinators can implement only the proof traits that are relevant to their intended use cases
(e.g., formats that accept non-canonical encodings may not be non-malleable, and thus would not implement
proof::NonMalleable).
§fns — Spec Function Combinators
Type aliases and trait implementations that allow plain Verus spec_fns
to be used as combinators without defining new types.