pub fn add_reference(&mut self, tuple_id: EntryID) -> Result<()> {
        let serialized_reference = tuple_id.to_le_bytes();
        let data_bytes =
            unsafe { std::slice::from_raw_parts_mut(self.data_bytes, self.data_length) };
        if let Some(new_references) = self.references.checked_sub(1) {
            self.references = new_references;
            self.data_length -= serialized_reference.len();
            let start_bytes = data_bytes.len() - serialized_reference.len();
            data_bytes[start_bytes..].copy_from_slice(&serialized_reference);
            Ok(())
        } else {
            Err(SlottedPageError::InsufficientSpace(
                serialized_reference.len(),
                self.data_length,
            ))
        }
    }
/// Adds a reference to the guard.
Adds a reference to the guard.
Adds a reference to the guard .
pub fn add_reference(&mut self, tuple_id: EntryID) -> Result<()> {
        let serialized_reference = tuple_id.to_le_bytes();
        let data_bytes =
            unsafe { std::slice::from_raw_parts_mut(self.data_bytes, self.data_length) };
        if let Some(new_references) = self.references.checked_sub(1) {
            self.references = new_references;
            self.data_length -= serialized_reference.len();
            let start_bytes = data_bytes.len() - serialized_reference.len();
            data_bytes[start_bytes..].copy_from_slice(&serialized_reference);
            Ok(())
        } else {
            Err(SlottedPageError::InsufficientSpace(
                serialized_reference.len(),
                self.data_length,
            ))
        }
    }
pub fn add_reference ( & mut self , tuple_id : EntryID ) -> Result < ( ) > { let serialized_reference = tuple_id . to_le_bytes ( ) ; let data_bytes = unsafe { std :: slice :: from_raw_parts_mut ( self . data_bytes , self . data_length ) } ; if let Some ( new_references ) = self . references . checked_sub ( 1 ) { self . references = new_references ; self . data_length -= serialized_reference . len ( ) ; let start_bytes = data_bytes . len ( ) - serialized_reference . len ( ) ; data_bytes [ start_bytes .. ] . copy_from_slice ( & serialized_reference ) ; Ok ( ( ) ) } else { Err ( SlottedPageError :: InsufficientSpace ( serialized_reference . len ( ) , self . data_length , ) ) } }
Adds a reference to the guard.
Adds a reference to the guard .
&mut self
tuple_id
EntryID
&mut self
tuple_id
EntryID