/// Decode the type expected from the persistent binary form.
Decode the type expected from the persistent binary form.
Decode the type expected from the persistent binary form .
pub fn decode_persistent<T: Decodable>(bytes: &[u8]) -> Result<T> {
    let context = Context {};
    let header_len = <PersistentHeader as Layout>::inline_size(&context);
    if bytes.len() < header_len {
        return Err(Error::OutOfRange);
    }
    let (header_bytes, body_bytes) = bytes.split_at(header_len);
    let header = decode_persistent_header(header_bytes)?;
    decode_persistent_body(body_bytes, &header)
}
pub fn decode_persistent < T : Decodable > ( bytes : & [ u8 ] ) -> Result < T > { let context = Context { } ; let header_len = < PersistentHeader as Layout > :: inline_size ( & context ) ; if bytes . len ( ) < header_len { return Err ( Error :: OutOfRange ) ; } let ( header_bytes , body_bytes ) = bytes . split_at ( header_len ) ; let header = decode_persistent_header ( header_bytes ) ? ; decode_persistent_body ( body_bytes , & header ) }
Decode the type expected from the persistent binary form.
Decode the type expected from the persistent binary form .
bytes
&[u8]