pub enum Expr {
Show 31 variants
LitArray(Vec<Expr>),
LitNull(SimpleType),
LitBool(bool),
LitAuto(i64),
LitI16(i16),
LitI32(i32),
LitI64(i64),
LitU32(u32),
LitF32(f32),
LitF64(f64),
LitString(String),
LitBytes(Vec<u8>),
LitUtcTimeSChrono(DateTime<Utc>),
LitUtcTimeMsChrono(DateTime<Utc>),
LitFixedOffsetTimeChrono(DateTime<FixedOffset>),
LitUtcTimeSJiff(Timestamp),
LitUtcTimeMsJiff(Timestamp),
Param {
name: String,
type_: Type,
},
Field(FieldRef),
BinOp {
left: Box<Expr>,
op: BinOp,
right: Box<Expr>,
},
BinOpChain {
op: BinOp,
exprs: Vec<Expr>,
},
PrefixOp {
op: PrefixOp,
right: Box<Expr>,
},
Call {
func: String,
args: Vec<Expr>,
compute_type: ComputeType,
filter: Option<Box<Expr>>,
},
Window {
expr: Box<Expr>,
partition_by: Vec<Expr>,
order_by: Vec<(Expr, Order)>,
frame: Option<WindowFrame>,
},
Select(Box<Select>),
Cast(Box<Expr>, Type),
Exists(Box<Select>),
Collate(Box<Expr>, String),
Like {
expr: Box<Expr>,
pattern: Box<Expr>,
escape: Option<Box<Expr>>,
glob: bool,
},
Between {
e: Box<Expr>,
negated: bool,
low: Box<Expr>,
high: Box<Expr>,
},
Case {
operand: Option<Box<Expr>>,
conditions: Vec<(Expr, Expr)>,
else_: Option<Box<Expr>>,
},
}Variants§
LitArray(Vec<Expr>)
LitNull(SimpleType)
LitBool(bool)
LitAuto(i64)
LitI16(i16)
LitI32(i32)
LitI64(i64)
LitU32(u32)
LitF32(f32)
LitF64(f64)
LitString(String)
LitBytes(Vec<u8>)
LitUtcTimeSChrono(DateTime<Utc>)
LitUtcTimeMsChrono(DateTime<Utc>)
LitFixedOffsetTimeChrono(DateTime<FixedOffset>)
LitUtcTimeSJiff(Timestamp)
LitUtcTimeMsJiff(Timestamp)
Param
A query parameter. This will become a parameter to the generated Rust function
with the specified name and type_.
Field(FieldRef)
This evaluates to the value of a field in the query main or joined tables. If
you’ve aliased tables or field names, you’ll have to instantiate FieldId
yourself with the appropriate values. For synthetic values like function
results you may need a FieldId with an empty TableId ("").
BinOp
BinOpChain
PrefixOp
Call
Window
Fields
§
frame: Option<WindowFrame>Select(Box<Select>)
A sub SELECT query.
Cast(Box<Expr>, Type)
This is a synthetic expression, saying to treat the result of the expression as having the specified type. Use this for casting between primitive types and Rust new-types for instance.
Exists(Box<Select>)
Collate(Box<Expr>, String)
Like
Between
Case
Implementations§
Trait Implementations§
Source§impl From<SerialExpr> for Expr
impl From<SerialExpr> for Expr
Source§fn from(s: SerialExpr) -> Expr
fn from(s: SerialExpr) -> Expr
Converts to this type from the input type.
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