Function read_vec

Source
pub fn read_vec<R: Read, T, F: Fn(&mut R) -> Result<T>>(
    f: F,
    length_bound: Option<usize>,
    r: &mut R,
) -> Result<Vec<T>>
Expand description

Read a length-prefixed variable-length list of elements.

An optional bound on the length of the result may be provided. If None, the returned Vec will be of the length read off the reader, if successfully read. If Some(_), an error will be raised if the length read off the read is greater than the bound.