pub fn from_bytes(id: EntryId, bytes: &[u8]) -> Result<SerializedEntry> {
        if bytes.len() < HEADER_SIZE {
            let msg = format!("entry header too small: {}", bytes.len());
            return Err(ErrorKind::ParseFailure(msg).into());
        }

        Ok(SerializedEntry {
            id: id,
            class: Class::from_bytes(&bytes[0..HEADER_SIZE])?,
            data: &bytes[HEADER_SIZE..],
        })
    }
/// Parse entry header and determine its type
Parse entry header and determine its type
Parse entry header and determine its type
pub fn from_bytes(id: EntryId, bytes: &[u8]) -> Result<SerializedEntry> {
        if bytes.len() < HEADER_SIZE {
            let msg = format!("entry header too small: {}", bytes.len());
            return Err(ErrorKind::ParseFailure(msg).into());
        }
        Ok(SerializedEntry {
            id: id,
            class: Class::from_bytes(&bytes[0..HEADER_SIZE])?,
            data: &bytes[HEADER_SIZE..],
        })
    }
pub fn from_bytes ( id : EntryId , bytes : & [ u8 ] ) -> Result < SerializedEntry > { if bytes . len ( ) < HEADER_SIZE { let msg = format ! ( " " bytes len ( ) ) ; return Err ( ErrorKind :: ParseFailure ( msg ) . into ( ) ) ; } Ok ( SerializedEntry { id : id , class : Class :: from_bytes ( & bytes [ 0 .. HEADER_SIZE ] ) ? , data : & bytes [ HEADER_SIZE .. ] , } ) }
Parse entry header and determine its type
Parse entry header and determine its type
id
EntryId
bytes
&[u8]
id
EntryId
bytes
&[u8]