Skip to main content

Expression

Enum Expression 

Source
pub enum Expression {
Show 17 variants Func(Func), Aliased(Aliased), Between(Between), Binary(Binary), CaseWhen(CaseWhen), Cast(Cast), Conditional(Conditional), Exists(Exists), In(In), Subquery(Subquery), Unary(Unary), Window(Window), Literal(Literal), Placeholder(Placeholder), Raw(Raw), Column(Column), Star(Star),
}
Expand description

An expression: a column, a literal, an operation, a function call, a subquery.

PHP: the Utopia\Query\AST\Expression interface; each variant is one of its implementations.

Variants§

§

Func(Func)

A function call.

§

Aliased(Aliased)

An expression with an alias.

§

Between(Between)

x [NOT] BETWEEN low AND high.

§

Binary(Binary)

A binary operation.

§

CaseWhen(CaseWhen)

One WHEN ... THEN ... of a CASE, on its own (no serializer writes it outside a Conditional).

§

Cast(Cast)

CAST(x AS type).

§

Conditional(Conditional)

CASE ... END.

§

Exists(Exists)

[NOT] EXISTS (subquery).

§

In(In)

x [NOT] IN (...).

§

Subquery(Subquery)

A scalar subquery.

§

Unary(Unary)

A unary operation (prefix, or postfix like IS NULL).

§

Window(Window)

A window function call (... OVER (...)).

§

Literal(Literal)

A literal value.

§

Placeholder(Placeholder)

A bound parameter placeholder.

§

Raw(Raw)

SQL written as is.

§

Column(Column)

A column reference.

§

Star(Star)

* or table.*.

Implementations§

Source§

impl Expression

Source

pub const fn php_class(&self) -> &'static str

The PHP class of the node, relative to Utopia\Query\AST\.

Trait Implementations§

Source§

impl Clone for Expression

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Expression

Source§

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

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

impl From<Aliased> for Expression

Source§

fn from(node: Aliased) -> Self

The node as an expression.

Source§

impl From<Between> for Expression

Source§

fn from(node: Between) -> Self

The node as an expression.

Source§

impl From<Binary> for Expression

Source§

fn from(node: Binary) -> Self

The node as an expression.

Source§

impl From<CaseWhen> for Expression

Source§

fn from(node: CaseWhen) -> Self

The node as an expression.

Source§

impl From<Cast> for Expression

Source§

fn from(node: Cast) -> Self

The node as an expression.

Source§

impl From<Column> for Expression

Source§

fn from(node: Column) -> Self

The node as an expression.

Source§

impl From<Conditional> for Expression

Source§

fn from(node: Conditional) -> Self

The node as an expression.

Source§

impl From<Exists> for Expression

Source§

fn from(node: Exists) -> Self

The node as an expression.

Source§

impl From<Func> for Expression

Source§

fn from(node: Func) -> Self

The node as an expression.

Source§

impl From<In> for Expression

Source§

fn from(node: In) -> Self

The node as an expression.

Source§

impl From<Literal> for Expression

Source§

fn from(node: Literal) -> Self

The node as an expression.

Source§

impl From<Placeholder> for Expression

Source§

fn from(node: Placeholder) -> Self

The node as an expression.

Source§

impl From<Raw> for Expression

Source§

fn from(node: Raw) -> Self

The node as an expression.

Source§

impl From<Star> for Expression

Source§

fn from(node: Star) -> Self

The node as an expression.

Source§

impl From<Subquery> for Expression

Source§

fn from(node: Subquery) -> Self

The node as an expression.

Source§

impl From<Unary> for Expression

Source§

fn from(node: Unary) -> Self

The node as an expression.

Source§

impl From<Window> for Expression

Source§

fn from(node: Window) -> Self

The node as an expression.

Source§

impl PartialEq for Expression

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Expression

Auto Trait Implementations§

§

impl !Freeze for Expression

§

impl Forget for Expression

§

impl Move for Expression

§

impl RefUnwindSafe for Expression

§

impl Send for Expression
where RawVecInner: Send, BoxRaw<Expression>: Send, BoxRaw<Select>: Send, BoxRaw<WindowSpecification>: Send, &'static [u8]: Send, Bytes: Send, Arc<Repr<Object>>: Send, BoxRaw<Query>: Send,

§

impl Sync for Expression
where RawVecInner: Sync, BoxRaw<Expression>: Sync, BoxRaw<Select>: Sync, BoxRaw<WindowSpecification>: Sync, Bytes: Sync, Arc<Repr<Object>>: Sync, BoxRaw<Query>: Sync,

§

impl Unpin for Expression
where *const u8 is !null: Unpin, Box<Expression>: Unpin, Box<Select>: Unpin, Box<WindowSpecification>: Unpin, &'static [u8]: Unpin, *const u8: Unpin, Align8<*mut ()>: Unpin, &'static Vtable: Unpin, Arc<Repr<Object>>: Unpin, Box<Query>: Unpin,

§

impl UnsafeUnpin for Expression

§

impl UnwindSafe for Expression
where RawVecInner: UnwindSafe, BoxRaw<Expression>: UnwindSafe, BoxRaw<Select>: UnwindSafe, BoxRaw<WindowSpecification>: UnwindSafe, &'static [u8]: UnwindSafe, *const u8: UnwindSafe, Align8<*mut ()>: UnwindSafe, &'static Vtable: UnwindSafe, Arc<Repr<Object>>: UnwindSafe, BoxRaw<Query>: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.