pub fn read_at(data: &[u8], index: usize) -> Result<Option<Record>, ProgramError> {
        let offset = RefDB::get_offset(data, index)?;
        let ref_type = RefDB::get_reference_type(data)?;
        let record = Record::unpack(&data[offset..], ref_type, Some(index as u32))?;
        if record.counter > 0 {
            Ok(Some(record))
        } else {
            Ok(None)
        }
    }
/// Returns the record at the given index
Returns the record at the given index
Returns the record at the given index
pub fn read_at(data: &[u8], index: usize) -> Result<Option<Record>, ProgramError> {
        let offset = RefDB::get_offset(data, index)?;
        let ref_type = RefDB::get_reference_type(data)?;
        let record = Record::unpack(&data[offset..], ref_type, Some(index as u32))?;
        if record.counter > 0 {
            Ok(Some(record))
        } else {
            Ok(None)
        }
    }
pub fn read_at ( data : & [ u8 ] , index : usize ) -> Result < Option < Record > , ProgramError > { let offset = RefDB :: get_offset ( data , index ) ? ; let ref_type = RefDB :: get_reference_type ( data ) ? ; let record = Record :: unpack ( & data [ offset .. ] , ref_type , Some ( index as u32 ) ) ? ; if record . counter > 0 { Ok ( Some ( record ) ) } else { Ok ( None ) } }
Returns the record at the given index
Returns the record at the given index
data
&[u8]
index
usize
data
&[u8]
index
usize