Skip to main content

decode_binary

Function decode_binary 

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

Decode a value from ASUN binary bytes.

The lifetime 'de allows zero-copy decoding: any &'de str fields in the target type will borrow directly from data with no allocation.

§Example

let user: User = asun::decode_binary(&bytes)?;