fn read_index(
        buf: &DmaBuf,
        header: &MetaDataHeader,
    ) -> Result<Vec<MetaDataIndexEntry>, MetaDataError> {
        let index = MetaDataIndexEntry::from_slice(
            buf.as_slice(),
            header.used_entries,
        )?;
        let checksum = MetaDataIndexEntry::checksum(&index);
        if checksum != header.index_checksum {
            return Err(MetaDataError::IndexChecksum {});
        }
        Ok(index)
    }
/// Construct index array from raw data
Construct index array from raw data
Construct index array from raw data
fn read_index(
        buf: &DmaBuf,
        header: &MetaDataHeader,
    ) -> Result<Vec<MetaDataIndexEntry>, MetaDataError> {
        let index = MetaDataIndexEntry::from_slice(
            buf.as_slice(),
            header.used_entries,
        )?;
        let checksum = MetaDataIndexEntry::checksum(&index);
        if checksum != header.index_checksum {
            return Err(MetaDataError::IndexChecksum {});
        }
        Ok(index)
    }
fn read_index ( buf : & DmaBuf , header : & MetaDataHeader , ) -> Result < Vec < MetaDataIndexEntry > , MetaDataError > { let index = MetaDataIndexEntry :: from_slice ( buf . as_slice ( ) , header . used_entries , ) ? ; let checksum = MetaDataIndexEntry :: checksum ( & index ) ; if checksum != header . index_checksum { return Err ( MetaDataError :: IndexChecksum { } ) ; } Ok ( index ) }
Construct index array from raw data
Construct index array from raw data
buf
&DmaBuf
header
&MetaDataHeader