Skip to main content

borrow_bounded_str

Function borrow_bounded_str 

Source
pub fn borrow_bounded_str<const N: usize>(
    input: &[u8],
) -> Result<(&str, usize), ProgramError>
Expand description

Borrow one bounded UTF-8 string from a compact dynamic-tail payload.

The returned usize is the number of bytes consumed from input, so a generated view can walk subsequent compact-tail fields without decoding the whole tail into an owned value.