Enum spacetimedb_vm::expr::SourceExpr
source · pub enum SourceExpr {
InMemory {
source_id: SourceId,
header: Arc<Header>,
table_type: StTableType,
table_access: StAccess,
row_count: RowCount,
},
DbTable(DbTable),
}Expand description
A reference to a table within a query plan, used as the source for selections, scans, filters and joins.
Variants§
InMemory
A plan for a “virtual” or projected table.
The actual in-memory table, e.g., MemTable or &'a [ProductValue]
is not stored within the query plan;
rather, the source_id is an index which corresponds to the table in e.g., a SourceSet.
This allows query plans to be reused by supplying e.g., a new SourceSet.
Fields
§
table_type: StTableTypeDbTable(DbTable)
Implementations§
source§impl SourceExpr
impl SourceExpr
pub fn table_name(&self) -> &str
pub fn table_type(&self) -> StTableType
pub fn table_access(&self) -> StAccess
pub fn head(&self) -> &Arc<Header>
pub fn is_mem_table(&self) -> bool
pub fn is_db_table(&self) -> bool
pub fn from_mem_table( header: Arc<Header>, table_access: StAccess, row_count: usize, id: SourceId ) -> Self
pub fn table_id(&self) -> Option<TableId>
sourcepub fn get_db_table(&self) -> Option<&DbTable>
pub fn get_db_table(&self) -> Option<&DbTable>
If self refers to a DbTable, get a reference to it.
Returns None if self refers to a MemTable.
In that case, retrieving the MemTable requires inspecting the plan’s corresponding SourceSet
via [SourceSet::take_mem_table] or SourceSet::take_table.
Trait Implementations§
source§impl AuthAccess for SourceExpr
impl AuthAccess for SourceExpr
source§impl Clone for SourceExpr
impl Clone for SourceExpr
source§fn clone(&self) -> SourceExpr
fn clone(&self) -> SourceExpr
Returns a copy 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 SourceExpr
impl Debug for SourceExpr
source§impl Display for SourceExpr
impl Display for SourceExpr
source§impl From<&TableSchema> for SourceExpr
impl From<&TableSchema> for SourceExpr
source§fn from(value: &TableSchema) -> Self
fn from(value: &TableSchema) -> Self
Converts to this type from the input type.
source§impl From<SourceExpr> for QueryExpr
impl From<SourceExpr> for QueryExpr
source§fn from(source: SourceExpr) -> Self
fn from(source: SourceExpr) -> Self
Converts to this type from the input type.
source§impl Hash for SourceExpr
impl Hash for SourceExpr
source§impl PartialEq for SourceExpr
impl PartialEq for SourceExpr
source§fn eq(&self, other: &SourceExpr) -> bool
fn eq(&self, other: &SourceExpr) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Relation for SourceExpr
impl Relation for SourceExpr
impl Eq for SourceExpr
impl StructuralPartialEq for SourceExpr
Auto Trait Implementations§
impl Freeze for SourceExpr
impl RefUnwindSafe for SourceExpr
impl Send for SourceExpr
impl Sync for SourceExpr
impl Unpin for SourceExpr
impl UnwindSafe for SourceExpr
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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