Skip to main content

write_tail

Function write_tail 

Source
pub fn write_tail<T: TailCodec>(
    data: &mut [u8],
    body_end: usize,
    tail: &T,
) -> Result<usize, ProgramError>
Expand description

Encode tail into the account’s tail slot, rewriting the u32 length prefix. Returns AccountDataTooSmall when the existing account byte buffer can’t fit the encoded payload. in that case the caller should realloc first.