Skip to main content

Crate varta_vlp

Crate varta_vlp 

Source
Expand description

Varta Lifeline Protocol — 32-byte fixed-layout health frame.

This crate is the protocol root for Varta v0.1.0. It defines the on-wire Frame representation that agents emit and observers decode, the Status enum that classifies an agent’s last reported health, and the DecodeError returned when validation fails. Every helper operates on fixed-size byte arrays so the steady-state path on either side of the socket is heap-clean.

The crate compiles as #![no_std] by default and pulls in zero allocator usage; the optional std feature enables Key::from_file and related std::path::Path-typed conveniences.

See book/src/architecture/vlp-frame.md for the byte map and design notes.

Re-exports§

pub use util::ct_eq;
pub use util::decode_hex_32;
pub use util::HexDecodeError;

Modules§

crc32c
CRC-32C (Castagnoli) — wire-frame integrity check.
util
Allocation-free utilities shared across protocol layers.

Structs§

Frame
On-wire health frame — exactly 32 bytes, 8-byte aligned, little-endian integer fields. The struct is repr(C) so its layout is ABI-stable across compilations and trivially verifiable by inspection.

Enums§

DecodeError
Error returned by Frame::decode and Status::try_from_u8.
Status
Health status reported by an agent in a single VLP frame.

Constants§

MAGIC
Magic prefix on every VLP frame. ASCII "VA", intentionally readable in hex dumps so a stray byte stream is easy to identify.
NONCE_TERMINAL
Sentinel nonce value reserved for terminal panic frames.
VERSION
Current Varta Lifeline Protocol version. v0.2 introduces the CRC-32C integrity trailer at bytes 28..32 and shrinks payload from u64 to u32 to fit it. v0.1 frames decode as DecodeError::BadVersion.