pub struct FormatV1;
Expand description
Version 1 format (no TTL support)
Trait Implementations§
Source§impl RecordFormat for FormatV1
impl RecordFormat for FormatV1
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 FormatV1
impl RefUnwindSafe for FormatV1
impl Send for FormatV1
impl Sync for FormatV1
impl Unpin for FormatV1
impl UnwindSafe for FormatV1
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