Skip to main content

AliasedExpr

Struct AliasedExpr 

Source
pub struct AliasedExpr<E> { /* private fields */ }
Expand description

An expression aliased with AS "name".

Preserves the original expression’s type information (ExprValueType, Expr, etc.) so that aliased columns in SELECT tuples still infer the correct row type.

Trait Implementations§

Source§

impl<E: Clone> Clone for AliasedExpr<E>

Source§

fn clone(&self) -> AliasedExpr<E>

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<E: Copy> Copy for AliasedExpr<E>

Source§

impl<E: Debug> Debug for AliasedExpr<E>

Source§

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

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

impl<'a, V, E> Expr<'a, V> for AliasedExpr<E>
where V: SQLParam + 'a, E: Expr<'a, V>,

Source§

type SQLType = <E as Expr<'a, V>>::SQLType

The SQL data type this expression evaluates to.
Source§

type Nullable = <E as Expr<'a, V>>::Nullable

Whether this expression can be NULL.
Source§

type Aggregate = <E as Expr<'a, V>>::Aggregate

Whether this is an aggregate (COUNT, SUM) or scalar expression.
Source§

fn to_expr_sql(&self) -> SQL<'a, V>

Render this value as a scalar expression by reference. Read more
Source§

fn into_expr_sql(self) -> SQL<'a, V>

Render this value as a scalar expression, consuming it when useful.
Source§

impl<E: ExprValueType> ExprValueType for AliasedExpr<E>

Source§

impl<E: GroupByIdentity> GroupByIdentity for AliasedExpr<E>

Source§

impl<E: HasAggStatus> HasAggStatus for AliasedExpr<E>

Source§

impl<E> IntoSelectTarget for AliasedExpr<E>
where E: ExprValueType,

Source§

impl<'a, V, E> ToSQL<'a, V> for AliasedExpr<E>
where V: SQLParam + 'a, E: ToSQL<'a, V>,

Source§

fn to_sql(&self) -> SQL<'a, V>

Source§

fn into_sql(self) -> SQL<'a, V>

Consume self and return SQL without cloning. Default delegates to to_sql() (which clones). Types that own their SQL (like SQL and SQLExpr) override this to avoid the clone.

Auto Trait Implementations§

§

impl<E> Freeze for AliasedExpr<E>
where E: Freeze,

§

impl<E> RefUnwindSafe for AliasedExpr<E>
where E: RefUnwindSafe,

§

impl<E> Send for AliasedExpr<E>
where E: Send,

§

impl<E> Sync for AliasedExpr<E>
where E: Sync,

§

impl<E> Unpin for AliasedExpr<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for AliasedExpr<E>
where E: UnsafeUnpin,

§

impl<E> UnwindSafe for AliasedExpr<E>
where E: UnwindSafe,

Blanket Implementations§

Source§

impl<T> AliasExt for T

Source§

fn alias(self, name: &'static str) -> AliasedExpr<Self>

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<'a, V, L, R> ComparisonOperand<'a, V, L> for R
where V: SQLParam + 'a, L: Expr<'a, V>, R: Expr<'a, V>, <L as Expr<'a, V>>::SQLType: Compatible<<R as Expr<'a, V>>::SQLType>,

Source§

type SQLType = <R as Expr<'a, V>>::SQLType

Source§

type Aggregate = <R as Expr<'a, V>>::Aggregate

Source§

fn into_comparison_sql(self) -> SQL<'a, V>

Source§

impl<'a, V, E> ExprExt<'a, V> for E
where V: SQLParam, E: Expr<'a, V>,

Source§

fn eq<R>( self, other: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>, Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,

Equality comparison (=). Read more
Source§

fn ne<R>( self, other: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>, Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,

Inequality comparison (<>). Read more
Source§

fn gt<R>( self, other: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>, Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,

Greater-than comparison (>). Read more
Source§

fn ge<R>( self, other: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>, Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,

Greater-than-or-equal comparison (>=). Read more
Source§

fn lt<R>( self, other: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>, Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,

Less-than comparison (<). Read more
Source§

fn le<R>( self, other: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>, Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,

Less-than-or-equal comparison (<=). Read more
Source§

fn like<R>( self, pattern: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType> + Textual, <R as ComparisonOperand<'a, V, Self>>::SQLType: Textual, Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,

LIKE pattern matching. Read more
Source§

fn not_like<R>( self, pattern: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType> + Textual, <R as ComparisonOperand<'a, V, Self>>::SQLType: Textual, Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,

NOT LIKE pattern matching. Read more
Source§

fn is_null( self, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate>

IS NULL check. Read more
Source§

fn is_not_null( self, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate>

IS NOT NULL check. Read more
Source§

fn between<L, H>( self, low: L, high: H, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <<Self::Aggregate as AggOr<<L as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output as AggOr<<H as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output>
where L: ComparisonOperand<'a, V, Self>, H: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<L as ComparisonOperand<'a, V, Self>>::SQLType> + Compatible<<H as ComparisonOperand<'a, V, Self>>::SQLType>, Self::Aggregate: AggOr<<L as ComparisonOperand<'a, V, Self>>::Aggregate>, <Self::Aggregate as AggOr<<L as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output: AggOr<<H as ComparisonOperand<'a, V, Self>>::Aggregate>,

BETWEEN comparison. Read more
Source§

fn not_between<L, H>( self, low: L, high: H, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <<Self::Aggregate as AggOr<<L as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output as AggOr<<H as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output>
where L: ComparisonOperand<'a, V, Self>, H: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<L as ComparisonOperand<'a, V, Self>>::SQLType> + Compatible<<H as ComparisonOperand<'a, V, Self>>::SQLType>, Self::Aggregate: AggOr<<L as ComparisonOperand<'a, V, Self>>::Aggregate>, <Self::Aggregate as AggOr<<L as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output: AggOr<<H as ComparisonOperand<'a, V, Self>>::Aggregate>,

NOT BETWEEN comparison. Read more
Source§

fn in_array<I, R>( self, values: I, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate>
where I: IntoIterator<Item = R>, R: Expr<'a, V>, Self::SQLType: Compatible<R::SQLType>,

IN array check. Read more
Source§

fn not_in_array<I, R>( self, values: I, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate>
where I: IntoIterator<Item = R>, R: Expr<'a, V>, Self::SQLType: Compatible<R::SQLType>,

NOT IN array check. Read more
Source§

fn in_subquery<S>( self, subquery: S, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate>
where S: Expr<'a, V>, Self::SQLType: Compatible<S::SQLType>,

IN subquery check.
Source§

fn not_in_subquery<S>( self, subquery: S, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate>
where S: Expr<'a, V>, Self::SQLType: Compatible<S::SQLType>,

NOT IN subquery check.
Source§

fn is_distinct_from<R>( self, other: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>, Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,

IS DISTINCT FROM - NULL-safe inequality comparison. Read more
Source§

fn is_not_distinct_from<R>( self, other: R, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, <Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output>
where R: ComparisonOperand<'a, V, Self>, Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>, Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,

IS NOT DISTINCT FROM - NULL-safe equality comparison. Read more
Source§

fn is_true( self, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate>

IS TRUE - boolean test that handles NULL. Read more
Source§

fn is_false( self, ) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate>

IS FALSE - boolean test that handles NULL. 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<Mk> MarkerAggValidFor<()> for Mk

Source§

impl<Scope> ScopeSatisfies<Nil, ()> for Scope

Source§

impl<E, Grouped> SingleColGroupCheck<Grouped, AggSkip> for E
where E: HasAggStatus<Status = AllAgg>,

Source§

impl<E, Grouped, W> SingleColGroupCheck<Grouped, ScalarCheck<W>> for E
where E: HasAggStatus<Status = AllScalar> + GroupByIdentity, Grouped: ScopeContains<<E as GroupByIdentity>::Identity, W>,

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.
Source§

impl<T> TypeEq<T> for T