Skip to main content

validate_slice

Function validate_slice 

Source
pub fn validate_slice(bytes: &[u8]) -> Result<()>
Expand description

Validate that bytes contains exactly one well-formed BEVE value.

This performs structural validation only and does not materialize a target type. The full input must be consumed by a single value; trailing bytes are rejected.

ยงExample

let bytes = beve::to_vec(&vec![1u32, 2, 3]).unwrap();
beve::validate_slice(&bytes).unwrap();