Skip to main content

Expression

Enum Expression 

Source
pub enum Expression<'a> {
Show 40 variants Binary(Box<BinaryExpression<'a>>), Unary(Box<UnaryExpression<'a>>), Subquery(Box<SubqueryExpression<'a>>), Null(Box<NullExpression>), Default(Box<DefaultExpression>), Bool(Box<BoolExpression>), String(Box<SString<'a>>), Integer(Box<IntegerExpression>), ListHack(Box<ListHackExpression>), Float(Box<FloatExpression>), Function(Box<FunctionCallExpression<'a>>), WindowFunction(Box<WindowFunctionCallExpression<'a>>), AggregateFunction(Box<AggregateFunctionCallExpression<'a>>), Identifier(Box<IdentifierExpression<'a>>), Interval(Box<IntervalExpression>), Arg(Box<ArgExpression>), Exists(Box<ExistsExpression<'a>>), Extract(Box<ExtractExpression<'a>>), Trim(Box<TrimExpression<'a>>), In(Box<InExpression<'a>>), Between(Box<BetweenExpression<'a>>), MemberOf(Box<MemberOfExpression<'a>>), Is(Box<IsExpression<'a>>), Invalid(Box<InvalidExpression>), Case(Box<CaseExpression<'a>>), Cast(Box<CastExpression<'a>>), Convert(Box<ConvertExpression<'a>>), GroupConcat(Box<GroupConcatExpression<'a>>), Variable(Box<VariableExpression<'a>>), UserVariable(Box<UserVariableExpression<'a>>), TimestampAdd(Box<TimestampAddExpression<'a>>), TimestampDiff(Box<TimestampDiffExpression<'a>>), TypeCast(Box<TypeCastExpression<'a>>), MatchAgainst(Box<MatchAgainstExpression<'a>>), Array(Box<ArrayExpression<'a>>), ArraySubscript(Box<ArraySubscriptExpression<'a>>), Quantifier(Box<QuantifierExpression<'a>>), FieldAccess(Box<FieldAccessExpression<'a>>), Char(Box<CharFunctionExpression<'a>>), Row(Box<RowExpression<'a>>),
}
Expand description

Representation of an expression

Variants§

§

Binary(Box<BinaryExpression<'a>>)

Expression with binary operator

§

Unary(Box<UnaryExpression<'a>>)

Expression with a unary (prefix) operator

§

Subquery(Box<SubqueryExpression<'a>>)

Subquery expression

§

Null(Box<NullExpression>)

Literal NULL expression

§

Default(Box<DefaultExpression>)

Literal DEFAULT expression

§

Bool(Box<BoolExpression>)

Literal bool expression “TRUE” or “FALSE”

§

String(Box<SString<'a>>)

Literal string expression, the SString contains the represented string with escaping removed

§

Integer(Box<IntegerExpression>)

Literal integer expression

§

ListHack(Box<ListHackExpression>)

Literal LIST

§

Float(Box<FloatExpression>)

Literal floating point expression

§

Function(Box<FunctionCallExpression<'a>>)

Function call expression,

§

WindowFunction(Box<WindowFunctionCallExpression<'a>>)

A window function call expression

§

AggregateFunction(Box<AggregateFunctionCallExpression<'a>>)

Aggregate function call expression with optional DISTINCT/FILTER/OVER

§

Identifier(Box<IdentifierExpression<'a>>)

Identifier pointing to column

§

Interval(Box<IntervalExpression>)

Time Interval

§

Arg(Box<ArgExpression>)

Input argument to query, the first argument is the occurrence number of the argument

§

Exists(Box<ExistsExpression<'a>>)

Exists expression

§

Extract(Box<ExtractExpression<'a>>)

Extract expression

§

Trim(Box<TrimExpression<'a>>)

Trim expression

§

In(Box<InExpression<'a>>)

In expression

§

Between(Box<BetweenExpression<'a>>)

Between expression

§

MemberOf(Box<MemberOfExpression<'a>>)

Member of expression

§

Is(Box<IsExpression<'a>>)

Is expression

§

Invalid(Box<InvalidExpression>)

Invalid expression, returned on recovery of a parse error

§

Case(Box<CaseExpression<'a>>)

Case expression

§

Cast(Box<CastExpression<'a>>)

Cast expression

§

Convert(Box<ConvertExpression<'a>>)

Convert expression (CONVERT(expr, type) or CONVERT(expr USING charset))

§

GroupConcat(Box<GroupConcatExpression<'a>>)

Group contat expression

§

Variable(Box<VariableExpression<'a>>)

Variable expression

§

UserVariable(Box<UserVariableExpression<'a>>)

User variable expression (@variable_name)

§

TimestampAdd(Box<TimestampAddExpression<'a>>)

Timestampadd call

§

TimestampDiff(Box<TimestampDiffExpression<'a>>)

Timestampdiff call

§

TypeCast(Box<TypeCastExpression<'a>>)

PostgreSQL-style typecast expression (expr::type)

§

MatchAgainst(Box<MatchAgainstExpression<'a>>)

Full-text MATCH … AGAINST expression

§

Array(Box<ArrayExpression<'a>>)

PostgreSQL ARRAY[…] literal expression

§

ArraySubscript(Box<ArraySubscriptExpression<'a>>)

Array subscript / slice expression: expr[idx] or expr[lower:upper]

§

Quantifier(Box<QuantifierExpression<'a>>)

PostgreSQL ANY / SOME / ALL quantifier: ANY(subquery_or_array)

§

FieldAccess(Box<FieldAccessExpression<'a>>)

PostgreSQL composite type field access: (expr).field

§

Char(Box<CharFunctionExpression<'a>>)

CHAR(N,… [USING charset_name]) expression

§

Row(Box<RowExpression<'a>>)

Row / tuple constructor: (expr1, expr2, ...)

Trait Implementations§

Source§

impl<'a> Clone for Expression<'a>

Source§

fn clone(&self) -> Expression<'a>

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<'a> Debug for Expression<'a>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a> Spanned for Expression<'a>

Source§

fn span(&self) -> Span

Compute byte span of an ast fragment
Source§

fn join_span(&self, other: &impl OptSpanned) -> Span

Compute the minimal span containing both self and other

Auto Trait Implementations§

§

impl<'a> Freeze for Expression<'a>

§

impl<'a> RefUnwindSafe for Expression<'a>

§

impl<'a> Send for Expression<'a>

§

impl<'a> Sync for Expression<'a>

§

impl<'a> Unpin for Expression<'a>

§

impl<'a> UnsafeUnpin for Expression<'a>

§

impl<'a> UnwindSafe for Expression<'a>

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> OptSpanned for T
where T: Spanned,

Source§

fn opt_span(&self) -> Option<Range<usize>>

Compute an optional byte span of an ast fragment
Source§

fn opt_join_span(&self, other: &impl OptSpanned) -> Option<Span>

Compute the minimal span containing both self and other if either is missing return the other
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.