Function solana_program::borsh::get_instance_packed_len

source ·
pub fn get_instance_packed_len<T: BorshSerialize>(
    instance: &T
) -> Result<usize, Error>
👎Deprecated since 1.17.0: Please use borsh0_10::get_instance_packed_len instead
Expand description

Get the packed length for the serialized form of this object instance.

Useful when working with instances of types that contain a variable-length sequence, such as a Vec or HashMap. Since it is impossible to know the packed length only from the type’s schema, this can be used when an instance already exists, to figure out how much space to allocate in an account.