pub struct Record {
pub key: Vec<u8>,
pub value: RwLock<Option<Bytes>>,
pub ttl_expiry: AtomicU64,
pub timestamp: u64,
pub value_len: usize,
pub sector: AtomicU64,
pub refcount: AtomicU32,
pub key_len: u16,
pub hash_link: AtomicLink,
pub cache_ref_bit: AtomicU32,
pub cache_access_time: AtomicU64,
/* private fields */
}Fields§
§key: Vec<u8>§value: RwLock<Option<Bytes>>§ttl_expiry: AtomicU64§timestamp: u64§value_len: usize§sector: AtomicU64§refcount: AtomicU32§key_len: u16§hash_link: AtomicLink§cache_ref_bit: AtomicU32§cache_access_time: AtomicU64Implementations§
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 new_with_timestamp_ttl( key: Vec<u8>, value: Vec<u8>, timestamp: u64, ttl_expiry: u64, ) -> Self
Sourcepub fn new_from_bytes(key: Vec<u8>, value: Bytes, timestamp: u64) -> Self
pub fn new_from_bytes(key: Vec<u8>, value: Bytes, timestamp: u64) -> Self
Create a new record from a Bytes value (zero-copy)
Sourcepub fn new_from_bytes_with_ttl(
key: Vec<u8>,
value: Bytes,
timestamp: u64,
ttl_expiry: u64,
) -> Self
pub fn new_from_bytes_with_ttl( key: Vec<u8>, value: Bytes, timestamp: u64, ttl_expiry: u64, ) -> Self
Create a new record from Bytes with TTL
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§
impl Send for Record
impl Sync for Record
Auto Trait Implementations§
impl !Freeze for Record
impl !RefUnwindSafe for Record
impl Unpin for Record
impl UnsafeUnpin 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