pub struct FormatV2;
Expand description
Version 2 format (with TTL support)
Trait Implementations§
Source§impl RecordFormat for FormatV2
impl RecordFormat for FormatV2
Source§fn record_header_size(&self, key_len: usize) -> usize
fn record_header_size(&self, key_len: usize) -> usize
Calculate the size of a record on disk (excluding value)
Source§fn total_size(&self, key_len: usize, value_len: usize) -> usize
fn total_size(&self, key_len: usize, value_len: usize) -> usize
Calculate total size including value
Source§fn serialize_record(&self, record: &Record, include_value: bool) -> Vec<u8> ⓘ
fn serialize_record(&self, record: &Record, include_value: bool) -> Vec<u8> ⓘ
Serialize a record to bytes for disk storage
Source§fn parse_record(&self, data: &[u8]) -> Option<(Vec<u8>, usize, u64, u64)>
fn parse_record(&self, data: &[u8]) -> Option<(Vec<u8>, usize, u64, u64)>
Parse a record from disk bytes (returns key, value_len, timestamp, ttl_expiry)
Source§fn value_offset(&self, key_len: usize) -> usize
fn value_offset(&self, key_len: usize) -> usize
Get the offset where value data starts in the serialized format
Auto Trait Implementations§
impl Freeze for FormatV2
impl RefUnwindSafe for FormatV2
impl Send for FormatV2
impl Sync for FormatV2
impl Unpin for FormatV2
impl UnwindSafe for FormatV2
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