Skip to main content

deserialize_from_slice

Function deserialize_from_slice 

Source
pub fn deserialize_from_slice<'a, T>(buf: &'a [u8]) -> Result<T>
where T: Deserialize<'a>,
Expand description

Deserializes a value from database record bytes.

The result may borrow from buf according to T’s deserialization implementation. Debug builds additionally verify that decoding consumed the input, apart from one trailing record separator.

§Panics

Panics if T requests a Serde data-model operation unsupported by this codec. In debug builds, decoding also panics when record-layout invariants are violated or unexpected trailing bytes remain.