Skip to main content

encode_sensing_container

Function encode_sensing_container 

Source
pub fn encode_sensing_container<'a>(
    profile: SensingIndexProfile,
    header: &Container10dHeader,
    identity: &ManifoldIdentityV2,
    container_id: [u8; 16],
    index_field_id: u64,
    raw_prefix: &[u8],
    raw_fields: &[TypedFieldRecord],
    records: &[MeasurementRecord],
    other_extensions: &[u16],
    payload_scratch: &'a mut [u8],
    manifest_scratch: &'a mut [u8],
    field_scratch: &mut [TypedFieldRecord],
    section_scratch: &mut [SectionInput<'a>],
    output: &mut [u8],
) -> Result<usize, SensingAssemblyError>
Expand description

Assemble a new envelope containing FieldSidecar and MID2 sections. All raw fields must refer to the supplied prefix; this does not rewrite an existing container or preserve other sections. Identity, namespaces and metadata are explicit caller declarations, not verified scientific or policy claims. Legacy FIEL descriptors are not authored here; their semantic pairing stays with the caller, as in PhysicalFieldSemantics::from_existing.

Scratch is caller-owned and may change on failure. The existing checked envelope writer validates before changing final output. Slice capacities are the caller-selected byte/entry budgets; this function allocates nothing.