Function vec_write_all

Source
fn vec_write_all<A>(
    pos_mut: &mut u64,
    vec: &mut Vec<u8, A>,
    buf: &[u8],
) -> Result<usize>
where A: Allocator,
Expand description

Resizing write_all implementation for Cursor.

Cursor is allowed to have a pre-allocated and initialised vector body, but with a position of 0. This means the Write will overwrite the contents of the vec.

This also allows for the vec body to be empty, but with a position of N. This means that Write will pad the vec with 0 initially, before writing anything from that point