Function to_vec_with_size_hint

Source
pub fn to_vec_with_size_hint<T, BO>(
    value: &T,
    capacity_hint: usize,
) -> Result<Vec<u8>>
where T: Serialize, BO: ByteOrder,
Expand description

Serialize to Vec<u8> Size hint indicates how many bytes to initially allocate for serialized data.