Skip to main content

RelationEntry

Struct RelationEntry 

Source
pub struct RelationEntry {
    pub row: Rc<Row>,
    pub is_combined: bool,
    /* private fields */
}
Expand description

A relation entry wraps a row with table context.

Fields§

§row: Rc<Row>

The underlying row (reference counted for efficient sharing).

§is_combined: bool

Whether this entry is from a joined relation.

Implementations§

Source§

impl RelationEntry

Source

pub fn new_shared(row: Rc<Row>, shared_tables: SharedTables) -> Self

Creates a relation entry with shared tables (avoids cloning for each row).

Source

pub fn new(row: Rc<Row>, tables: Vec<String>) -> Self

Creates a new relation entry.

Source

pub fn new_owned(row: Row, tables: Vec<String>) -> Self

Creates a new relation entry from an owned Row.

Source

pub fn new_combined(row: Rc<Row>, shared_tables: SharedTables) -> Self

Creates a combined relation entry with shared tables (for join results). This avoids cloning the tables vector for each result row.

Source

pub fn from_row(row: Rc<Row>, table: impl Into<String>) -> Self

Creates a relation entry from a single table.

Source

pub fn from_row_owned(row: Row, table: impl Into<String>) -> Self

Creates a relation entry from an owned Row and a single table.

Source

pub fn id(&self) -> RowId

Returns the row ID.

Source

pub fn tables(&self) -> &[String]

Returns the tables this entry belongs to.

Source

pub fn get_field(&self, index: usize) -> Option<&Value>

Gets a field value by column index.

Source

pub fn combine( left: &RelationEntry, left_tables: &[String], right: &RelationEntry, right_tables: &[String], ) -> Self

Combines two entries into a joined entry. The combined row’s version is the sum of both source row versions.

Source

pub fn combine_with_null( left: &RelationEntry, left_tables: &[String], right_column_count: usize, right_tables: &[String], ) -> Self

Creates a combined entry with null values for the right side (for outer joins). The combined row’s version is the left row’s version (right side is NULL).

Source

pub fn combine_fast( left: &RelationEntry, right: &RelationEntry, combined_tables: SharedTables, ) -> Self

Fast combine that reuses pre-computed tables (avoids repeated table name cloning). The combined row’s version is the sum of both source row versions.

Source

pub fn combine_with_null_fast( left: &RelationEntry, right_column_count: usize, combined_tables: SharedTables, ) -> Self

Fast combine with null that reuses pre-computed tables. The combined row’s version is the left row’s version (right side is NULL).

Trait Implementations§

Source§

impl Clone for RelationEntry

Source§

fn clone(&self) -> RelationEntry

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RelationEntry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.