Skip to main content

validate_reader

Function validate_reader 

Source
pub fn validate_reader<R: Read>(reader: R) -> Result<()>
Expand description

Validate BEVE data from any reader without deserializing into a concrete type.

This enforces the same semantics as validate_slice: exactly one valid BEVE value and no trailing bytes.

ยงExample

use std::io::Cursor;

let bytes = beve::to_vec(&123u32).unwrap();
beve::validate_reader(Cursor::new(bytes)).unwrap();