pub struct SlotRow { /* private fields */ }Expand description
Slot-based row format with O(1) field access
§Memory Layout
┌───────────────────────────────────────────────────────┐
│ Header (28 bytes) │
│ row_id: u64 (8 bytes) │
│ null_bitmap: u16 (2 bytes) │
│ slot_count: u8 (1 byte) │
│ flags: u8 (1 byte) │
│ txn_start: u64 (8 bytes) MVCC │
│ txn_end: u64 (8 bytes) MVCC │
├───────────────────────────────────────────────────────┤
│ Slots: [offset: u16, len: u16] × slot_count │
├───────────────────────────────────────────────────────┤
│ Data: contiguous column values │
└───────────────────────────────────────────────────────┘Implementations§
Source§impl SlotRow
impl SlotRow
Sourcepub fn new(row_id: u64, slot_count: u8) -> Self
pub fn new(row_id: u64, slot_count: u8) -> Self
Create a new slot row with specified column count
Sourcepub fn from_values(row_id: u64, values: &[Option<&[u8]>]) -> Self
pub fn from_values(row_id: u64, values: &[Option<&[u8]>]) -> Self
Create from raw values
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Get column count
Sourcepub fn get_bytes(&self, column_idx: usize) -> Option<&[u8]>
pub fn get_bytes(&self, column_idx: usize) -> Option<&[u8]>
Get column value as bytes - O(1)
This is the key performance advantage: direct offset arithmetic instead of HashMap lookup (~50ns → ~2ns)
Sourcepub fn is_visible_at(&self, snapshot_ts: u64) -> bool
pub fn is_visible_at(&self, snapshot_ts: u64) -> bool
Check if visible at snapshot
Sourcepub fn set_deleted(&mut self)
pub fn set_deleted(&mut self)
Set deleted flag
Sourcepub fn is_deleted(&self) -> bool
pub fn is_deleted(&self) -> bool
Check if deleted
Sourcepub fn memory_size(&self) -> usize
pub fn memory_size(&self) -> usize
Get total memory size
Sourcepub fn from_bytes(data: &[u8]) -> Option<Self>
pub fn from_bytes(data: &[u8]) -> Option<Self>
Deserialize from bytes
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SlotRow
impl RefUnwindSafe for SlotRow
impl Send for SlotRow
impl Sync for SlotRow
impl Unpin for SlotRow
impl UnsafeUnpin for SlotRow
impl UnwindSafe for SlotRow
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more