#[repr(C)]pub struct Record {
pub hash_link: AtomicLink,
pub key: Vec<u8>,
pub key_len: u16,
pub value: RwLock<Option<Bytes>>,
pub value_len: usize,
pub timestamp: u64,
pub sector: AtomicU64,
pub refcount: AtomicU32,
pub cache_ref_bit: AtomicU32,
pub cache_access_time: AtomicU64,
}
Fields§
§hash_link: AtomicLink
§key: Vec<u8>
§key_len: u16
§value: RwLock<Option<Bytes>>
§value_len: usize
§timestamp: u64
§sector: AtomicU64
§refcount: AtomicU32
§cache_ref_bit: AtomicU32
§cache_access_time: AtomicU64
Implementations§
Source§impl Record
impl Record
pub fn new(key: Vec<u8>, value: Vec<u8>, timestamp: u64) -> Self
pub fn new_with_timestamp(key: Vec<u8>, value: Vec<u8>, timestamp: u64) -> Self
pub fn calculate_size(&self) -> usize
pub fn calculate_disk_size(&self) -> usize
Sourcepub fn get_value(&self) -> Option<Bytes>
pub fn get_value(&self) -> Option<Bytes>
Get value - returns None if value has been offloaded to disk
Sourcepub fn clear_value(&self)
pub fn clear_value(&self)
Clear value from memory
pub fn inc_ref(&self)
pub fn dec_ref(&self) -> u32
pub fn ref_count(&self) -> u32
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Record
impl !RefUnwindSafe for Record
impl Unpin for Record
impl !UnwindSafe for Record
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