[][src]Function casperlabs_types::bytesrepr::allocate_buffer

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

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_value().