Skip to main content

from_reader_array

Function from_reader_array 

Source
pub fn from_reader_array<T, R>(reader: R) -> StreamResult<Vec<T>>
where T: NumericBytes, R: Read,
Expand description

read_array_into into a vector of its own.

Reading into one you keep is what bounds a loop’s peak at a single array; this is for the one-shot case.

let doc = structio::to_beve_aligned(&vec![1u32, 2, 3]);
let xs: Vec<u32> = structio::from_beve_reader_array(&doc[..])?;
assert_eq!(xs, [1, 2, 3]);