pub fn read_at_if_changed(
        data: &[u8],
        index: usize,
        last_counter: usize,
    ) -> Result<Option<Record>, ProgramError> {
        let offset = RefDB::get_offset(data, index)?;
        let counter = RefDB::get_record_counter(data, offset)?;
        if counter > last_counter {
            RefDB::read_at(data, index)
        } else {
            Ok(None)
        }
    }
/// Returns the record at the given index only if it has been updated
Returns the record at the given index only if it has been updated
Returns the record at the given index only if it has been updated
pub fn read_at_if_changed(
        data: &[u8],
        index: usize,
        last_counter: usize,
    ) -> Result<Option<Record>, ProgramError> {
        let offset = RefDB::get_offset(data, index)?;
        let counter = RefDB::get_record_counter(data, offset)?;
        if counter > last_counter {
            RefDB::read_at(data, index)
        } else {
            Ok(None)
        }
    }
pub fn read_at_if_changed ( data : & [ u8 ] , index : usize , last_counter : usize , ) -> Result < Option < Record > , ProgramError > { let offset = RefDB :: get_offset ( data , index ) ? ; let counter = RefDB :: get_record_counter ( data , offset ) ? ; if counter > last_counter { RefDB :: read_at ( data , index ) } else { Ok ( None ) } }
Returns the record at the given index only if it has been updated
Returns the record at the given index only if it has been updated
data
&[u8]
index
usize
last_counter
usize
data
&[u8]
index
usize
last_counter
usize