Skip to main content

validate_field_section

Function validate_field_section 

Source
fn validate_field_section(
    tag: u32,
    bytes: &[u8],
    count: usize,
) -> Result<(), CacheError>
Expand description

Validates that bytes holds exactly count field elements, i.e. that bytes.len() == count * FIELD_ELEMENT_BYTES. Purely a check — constructs nothing — so it is safe to call in the reader’s fallible validation phase before any mmap-backed Vec exists. tag is only used for the error.