Skip to main content

deserialize_prefix

Function deserialize_prefix 

Source
pub fn deserialize_prefix<'de, T>(bytes: &'de [u8]) -> Result<(T, &'de [u8])>
where T: Deserialize<'de>,
Expand description

Deserialize one value from the start of bytes and return the unconsumed suffix.

Borrowing outputs such as &[u8] remain views into the input. This is used for allocation-free inspection of bounded-admission envelope prefixes.