/// Writes a vector of values to the given writer using the provided callback to
/// serialize each value. This function differs from [`write_vec_cb`] in that it
/// uses `u16` prefixes to give the length of the vector instead of a `BigSize`.
Writes a vector of values to the given writer using the provided callback to
serialize each value.
Writes a vector of values to the given writer using the provided callback to serialize each value .
pub fn write_vec_u16_cb<W: Writer, T, F>(
    input: &[T],
    writer: &mut W,
    cb: &F,
) -> Result<(), ::std::io::Error>
where
    F: Fn(&T, &mut W) -> Result<(), ::std::io::Error>,
{
    (input.len() as u16).write(writer)?;
    for s in input {
        cb(s, writer)?;
    }
    Ok(())
}
pub fn write_vec_u16_cb < W : Writer , T , F > ( input : & [ T ] , writer : & mut W , cb : & F , ) -> Result < ( ) , :: std :: io :: Error > where F : Fn ( & T , & mut W ) -> Result < ( ) , :: std :: io :: Error > , { ( input . len ( ) as u16 ) . write ( writer ) ? ; for s in input { cb ( s , writer ) ? ; } Ok ( ( ) ) }
Writes a vector of values to the given writer using the provided callback to
serialize each value.
Writes a vector of values to the given writer using the provided callback to serialize each value .
input
&[T]
<not_specific>
writer
&mut W
<not_specific>
cb
&F
<not_specific>