pub struct CompositeRow { /* private fields */ }Expand description
A composite row that references values from two source rows.
This is the key optimization for joins - instead of cloning all values from both the left and right rows into a new row, we keep references to both and provide a unified view.
§Memory Layout
CompositeRow
├── left: Row (owned)
├── right: Row (owned)
└── left_cols: usize
Logical columns: [left_col_0, left_col_1, ..., right_col_0, right_col_1, ...]
|<--- left_cols --->|<--- right cols --->|Implementations§
Source§impl CompositeRow
impl CompositeRow
Sourcepub fn new(left: Row, right: Row) -> Self
pub fn new(left: Row, right: Row) -> Self
Create a new composite row from left and right parts.
Sourcepub fn with_counts(left: Row, right: Row, left_cols: usize) -> Self
pub fn with_counts(left: Row, right: Row, left_cols: usize) -> Self
Create a composite row with explicit column count.
Use this when the left row has been modified (e.g., projection).
Sourcepub fn get(&self, idx: usize) -> Option<&Value>
pub fn get(&self, idx: usize) -> Option<&Value>
Get a value by index without cloning.
Indexes 0..left_cols return from the left row. Indexes left_cols..total return from the right row.
Sourcepub fn materialize(&self) -> Row
pub fn materialize(&self) -> Row
Materialize into an owned Row (cloning version).
This creates a single Row by copying all values from both sides.
Only call this when the final result needs to be stored.
Prefer materialize_owned() when you can consume the CompositeRow.
Sourcepub fn materialize_owned(self) -> Row
pub fn materialize_owned(self) -> Row
Materialize into an owned Row by moving values (zero-copy).
This consumes the CompositeRow and moves all values without cloning.
Use this instead of materialize() when you no longer need the CompositeRow.
Sourcepub fn into_parts(self) -> (Row, Row)
pub fn into_parts(self) -> (Row, Row)
Decompose into the left and right rows.
Trait Implementations§
Source§impl Clone for CompositeRow
impl Clone for CompositeRow
Source§fn clone(&self) -> CompositeRow
fn clone(&self) -> CompositeRow
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompositeRow
impl Debug for CompositeRow
Auto Trait Implementations§
impl Freeze for CompositeRow
impl RefUnwindSafe for CompositeRow
impl Send for CompositeRow
impl Sync for CompositeRow
impl Unpin for CompositeRow
impl UnwindSafe for CompositeRow
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more