pub enum Expr {
Star {
qualifier: Slice,
},
Column {
name: Slice,
},
Literal {
kind: LiteralKind,
text: StrRef,
},
Unary {
op: UnaryOp,
operand: ExprRef,
},
Binary {
op: BinaryOp,
left: ExprRef,
right: ExprRef,
},
Function {
name: Slice,
args: Slice,
distinct: bool,
},
Cast {
operand: ExprRef,
ty: StrRef,
try_cast: bool,
},
Case {
operand: ExprRef,
arms: Slice,
otherwise: ExprRef,
},
Between {
operand: ExprRef,
low: ExprRef,
high: ExprRef,
negated: bool,
},
In {
operand: ExprRef,
list: Slice,
negated: bool,
},
Row {
items: Slice,
},
Subquery {
query: QueryRef,
},
}Expand description
One expression.
Twenty four bytes, which is the widest variant rounded up. The precedence chain in the grammar
does not survive into here: twenty levels of X <- Y Tail* become one Expr::Binary tree,
because the levels exist to make the grammar unambiguous and mean nothing afterwards.
Variants§
Star
*, or t.* with a qualifier.
Column
A column reference, qualified or not.
Literal
A literal, kept as the text that was written.
Fields
§
kind: LiteralKindWhich kind.
Unary
A prefix or postfix operator.
Binary
An infix operator.
Fields
Function
A function call.
Fields
Cast
CAST(x AS t) or TRY_CAST(x AS t).
Fields
Case
CASE, searched or simple.
Fields
Between
x BETWEEN a AND b.
Fields
In
x IN (a, b, c).
Fields
Row
A parenthesised list of more than one expression, which is a row value.
Subquery
A scalar subquery, (SELECT ...) where an expression is expected.
Trait Implementations§
impl Copy for Expr
impl Eq for Expr
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
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