/// Reads a vector of values from the given reader using the provided callback to
/// deserialize each value. This function differs from [`read_vec_cb`] in that it
/// uses `u16` prefixes to read the length of the vector instead of a `BigSize`.
Reads a vector of values from the given reader using the provided callback to
deserialize each value.
Reads a vector of values from the given reader using the provided callback to deserialize each value .
pub fn read_vec_u16_cb<R: ::std::io::Read, T, F>(
    reader: &mut R,
    cb: &F,
) -> Result<Vec<T>, DecodeError>
where
    F: Fn(&mut R) -> Result<T, DecodeError>,
{
    let len: u16 = Readable::read(reader)?;
    let mut res = Vec::<T>::new();
    for _ in 0..len {
        res.push(cb(reader)?);
    }
    Ok(res)
}
pub fn read_vec_u16_cb < R : :: std :: io :: Read , T , F > ( reader : & mut R , cb : & F , ) -> Result < Vec < T > , DecodeError > where F : Fn ( & mut R ) -> Result < T , DecodeError > , { let len : u16 = Readable :: read ( reader ) ? ; let mut res = Vec :: < T > :: new ( ) ; for _ in 0 .. len { res . push ( cb ( reader ) ? ) ; } Ok ( res ) }
Reads a vector of values from the given reader using the provided callback to
deserialize each value.
Reads a vector of values from the given reader using the provided callback to deserialize each value .
reader
&mut R
<not_specific>
cb
&F
<not_specific>