Skip to main content

Module envelope

Module envelope 

Source
Expand description

Wire envelope: magic, version, header, CRC framing.

Two-archive layout, little-endian:

[ 4 bytes : MAGIC = b"VRPS"        ]
[ 1 byte  : FORMAT_VERSION         ]
[ 4 bytes : header_archive_len u32 ]
[ N bytes : header rkyv archive    ]
[ M bytes : body rkyv archive      ]
[ 4 bytes : CRC32 over the preceding (9 + N + M) bytes ]

The header archive carries paradigm-agnostic metadata (WireEnvelopeHeader). The body archive belongs to each paradigm crate — vernier-partial ships and validates body bytes as opaque &[u8] and never touches paradigm-specific rkyv types. This keeps the dep DAG flat: paradigm crates depend on vernier-partial; vernier-partial does not depend on them.

Structs§

ArchivedWireEnvelopeHeader
An archived WireEnvelopeHeader
ValidatedView
Validated archive view passed to the body callback in with_validated_envelope. Carries the typed rank id (decoded from the header) plus the unaligned body bytes the callback will rkyv-access itself.
WireEnvelopeHeader
Paradigm-agnostic envelope header. Carries everything vernier-partial needs to validate cross-rank compatibility: paradigm + sub-kind, parity mode, dataset / params hashes, the shape fingerprint, and the rank id.
WireEnvelopeHeaderResolver
The resolver for an archived WireEnvelopeHeader

Constants§

FORMAT_VERSION
Wire-format version. Bumped on any breaking change to the framing or the archived header layout. Old versions are refused at decode with PartialFormatErrorKind::WrongVersion.
MAGIC
Wire-format magic: ASCII "VRPS" (vernier partial state). Every valid partial starts with these four bytes.

Functions§

encode
Serialize a header + already-archived body into a framed partial blob.
rank_id_from_archive
Read the typed rank_id field off an archived header. Centralized because Option<u32>’s archived form is ArchivedOption<u32> which needs the .as_ref().map(...) pattern at every read site.
with_validated_envelope
Validate a partial blob’s framing + header fields and run a callback on the validated view.