pub struct RecordInfo { /* private fields */ }Expand description
Record header, internal to FASTER.
The header is 8 bytes and contains:
- Previous address (48 bits): Points to the previous record in the hash chain
- Checkpoint version (13 bits): Version when record was created
- Invalid bit (1 bit): Whether the record has been invalidated
- Tombstone bit (1 bit): Whether this is a delete marker
- Final bit (1 bit): Whether this is the final record in a chain
Implementations§
Source§impl RecordInfo
impl RecordInfo
Sourcepub fn new(
previous_address: Address,
checkpoint_version: u16,
invalid: bool,
tombstone: bool,
final_bit: bool,
) -> Self
pub fn new( previous_address: Address, checkpoint_version: u16, invalid: bool, tombstone: bool, final_bit: bool, ) -> Self
Create a new record info.
Sourcepub fn from_control(control: u64) -> Self
pub fn from_control(control: u64) -> Self
Create a record info from raw control value.
Sourcepub fn previous_address(&self) -> Address
pub fn previous_address(&self) -> Address
Get the previous address in the hash chain.
Sourcepub fn set_previous_address(&self, addr: Address)
pub fn set_previous_address(&self, addr: Address)
Set the previous address.
Sourcepub fn checkpoint_version(&self) -> u16
pub fn checkpoint_version(&self) -> u16
Get the checkpoint version.
Sourcepub fn is_invalid(&self) -> bool
pub fn is_invalid(&self) -> bool
Check if the record is invalid.
Sourcepub fn set_invalid(&self, invalid: bool)
pub fn set_invalid(&self, invalid: bool)
Set the invalid flag.
Sourcepub fn is_tombstone(&self) -> bool
pub fn is_tombstone(&self) -> bool
Check if this is a tombstone (delete marker).
Sourcepub fn set_tombstone(&self, tombstone: bool)
pub fn set_tombstone(&self, tombstone: bool)
Set the tombstone flag.
Sourcepub fn in_read_cache(&self) -> bool
pub fn in_read_cache(&self) -> bool
Check if the previous address points to read cache.
Trait Implementations§
Source§impl Clone for RecordInfo
impl Clone for RecordInfo
Source§impl Debug for RecordInfo
impl Debug for RecordInfo
Auto Trait Implementations§
impl !Freeze for RecordInfo
impl RefUnwindSafe for RecordInfo
impl Send for RecordInfo
impl Sync for RecordInfo
impl Unpin for RecordInfo
impl UnwindSafe for RecordInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more