pub struct Descriptor {
pub universe: String,
pub source_format: u8,
pub format_basis: String,
pub models: Vec<EntropyModel>,
pub channels: Vec<EntropyChannelDescriptor>,
pub objects: Vec<Vec<u8>>,
pub program: Program,
pub source_sha256: [u8; 32],
pub source_len: u64,
}Expand description
The in-memory model of a .voldoc descriptor.
Fields§
§universe: StringUniverse declaration string.
source_format: u8Source-format class selector.
format_basis: StringHuman-readable basis for the format decision (provenance, not trust).
models: Vec<EntropyModel>Canonical entropy models referenced by channels.
channels: Vec<EntropyChannelDescriptor>Typed entropy channels referenced by the program.
objects: Vec<Vec<u8>>Raw byte objects referenced by the program.
program: ProgramThe reconstruction program.
source_sha256: [u8; 32]SHA-256 of the exact reconstructed source.
source_len: u64Exact reconstructed source length.
Implementations§
Source§impl Descriptor
impl Descriptor
Sourcepub fn serialize(&self) -> Result<(Vec<u8>, CostBreakdown)>
pub fn serialize(&self) -> Result<(Vec<u8>, CostBreakdown)>
Serialize to a complete .voldoc byte sequence plus cost attribution.
Sourcepub fn parse(bytes: &[u8], limits: Limits) -> Result<ParsedDescriptor>
pub fn parse(bytes: &[u8], limits: Limits) -> Result<ParsedDescriptor>
Parse a complete .voldoc byte sequence with structural validation.
This validates framing, universe identity, version, mandatory features,
record presence, the coverage certificate, and declared length. It does
not materialize or hash the reconstructed source; call
crate::materialize::materialize for that.