Enum spacetimedb_vm::expr::ColumnOp
source · pub enum ColumnOp {
Field(FieldExpr),
Cmp {
op: OpQuery,
lhs: Box<ColumnOp>,
rhs: Box<ColumnOp>,
},
}Variants§
Implementations§
source§impl ColumnOp
impl ColumnOp
pub fn new(op: OpQuery, lhs: ColumnOp, rhs: ColumnOp) -> Self
pub fn cmp( field: impl Into<FieldName>, op: OpCmp, value: impl Into<AlgebraicValue> ) -> Self
pub fn compare( &self, row: &RelValue<'_>, header: &Header ) -> Result<bool, ErrorVm>
sourcepub fn flatten_ands(self) -> SmallVec<[ColumnOp; 1]>
pub fn flatten_ands(self) -> SmallVec<[ColumnOp; 1]>
Flattens a nested conjunction of AND expressions.
For example, a = 1 AND b = 2 AND c = 3 becomes [a = 1, b = 2, c = 3].
This helps with splitting the kinds of queries,
that could be answered by a index,
from the ones that need to be executed with a scan.
sourcepub fn flatten_ands_ref(&self) -> SmallVec<[&'_ ColumnOp; 1]>
pub fn flatten_ands_ref(&self) -> SmallVec<[&'_ ColumnOp; 1]>
Flattens a nested conjunction of AND expressions.
For example, a = 1 AND b = 2 AND c = 3 becomes [a = 1, b = 2, c = 3].
This helps with splitting the kinds of queries,
that could be answered by a index,
from the ones that need to be executed with a scan.
Trait Implementations§
source§impl From<AlgebraicValue> for Box<ColumnOp>
impl From<AlgebraicValue> for Box<ColumnOp>
source§fn from(value: AlgebraicValue) -> Self
fn from(value: AlgebraicValue) -> Self
Converts to this type from the input type.
source§impl From<AlgebraicValue> for ColumnOp
impl From<AlgebraicValue> for ColumnOp
source§fn from(value: AlgebraicValue) -> Self
fn from(value: AlgebraicValue) -> Self
Converts to this type from the input type.
source§impl Ord for ColumnOp
impl Ord for ColumnOp
source§impl PartialEq for ColumnOp
impl PartialEq for ColumnOp
source§impl PartialOrd for ColumnOp
impl PartialOrd for ColumnOp
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for ColumnOp
impl StructuralPartialEq for ColumnOp
Auto Trait Implementations§
impl Freeze for ColumnOp
impl RefUnwindSafe for ColumnOp
impl Send for ColumnOp
impl Sync for ColumnOp
impl Unpin for ColumnOp
impl UnwindSafe for ColumnOp
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