pub struct RowReference { /* private fields */ }Expand description
A lightweight reference to a row in source data
Instead of cloning entire rows during query processing, RowReference
stores just enough information to locate the row when materialization
is needed.
§Memory Comparison
For a row with 10 columns averaging 32 bytes each:
- Full Row: 320+ bytes (plus heap allocations for strings)
- RowReference: 16 bytes (table_id + row_index)
This is 20x more memory efficient for intermediate results.
§Example
// Create references instead of copying rows
let refs: Vec<RowReference> = qualifying_indices
.iter()
.map(|&idx| RowReference::new(0, idx as u32))
.collect();
// Only materialize at output boundary
let output_rows: Vec<Row> = refs
.iter()
.map(|r| source_tables[r.table_id()].row(r.row_index()))
.collect();Implementations§
Trait Implementations§
Source§impl Clone for RowReference
impl Clone for RowReference
Source§fn clone(&self) -> RowReference
fn clone(&self) -> RowReference
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RowReference
impl Debug for RowReference
Source§impl Hash for RowReference
impl Hash for RowReference
Source§impl PartialEq for RowReference
impl PartialEq for RowReference
impl Copy for RowReference
impl Eq for RowReference
impl StructuralPartialEq for RowReference
Auto Trait Implementations§
impl Freeze for RowReference
impl RefUnwindSafe for RowReference
impl Send for RowReference
impl Sync for RowReference
impl Unpin for RowReference
impl UnwindSafe for RowReference
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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