Function allocate_buffer

Source
pub fn allocate_buffer<T: ToBytes>(
    to_be_serialized: &T,
) -> Result<Vec<u8>, Error>
Expand description

Returns a Vec<u8> initialized with sufficient capacity to hold to_be_serialized after serialization, or an error if the capacity would exceed u32::MAX.