Skip to main content

Keyed

Struct Keyed 

Source
pub struct Keyed<K, Req, S: SqlType> { /* private fields */ }
Expand description

An expression that carries its own row key K: count() and the window functions, whose identity is the function that produced them. Selecting two of the same one into a row is what row::Row::get rejects, and what LabelExt::label exists to resolve.

Trait Implementations§

Source§

impl<K, Req, S: SqlType> Clone for Keyed<K, Req, S>

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<K, Req, S: SqlType> IntoExpr for Keyed<K, Req, S>

Source§

type Sql = S

The SQL type this expression has. An associated type rather than a parameter because every implementor has exactly one — a column its declared type, a literal its leaf type — which is what lets a mismatch report itself as Comparable/AssignsTo rather than as an inference failure on a type nobody wrote.
Source§

type Req = Req

Source§

fn into_expr(self) -> Expr<Req, S>

Source§

impl<K, Req, S: SqlType> LabelExt for Keyed<K, Req, S>

Source§

fn label<K: LabelKey>(self, _key: K) -> Labeled<K, Self>

Source§

impl<K: Spelled, Req, S: SqlType> LookupKey for Keyed<K, Req, S>

Source§

impl<K, Req, S: BoolLike> Not for Keyed<K, Req, S>

Source§

type Output = Keyed<K, Req, S>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl<K, Req, S: SqlType, Scope, Idx> RowField<Scope, Idx> for Keyed<K, Req, S>
where Scope: Superset<Req, Idx>,

Source§

type Value = <S as SqlType>::Native

Source§

fn item(&self) -> SelectItem

Source§

impl<K, Req, S: SqlType> RowKey for Keyed<K, Req, S>

Source§

type Key = K

Source§

impl<K, Req, S: SqlType, Scope, Idx> Selection<Scope, Idx> for Keyed<K, Req, S>
where Keyed<K, Req, S>: RowField<Scope, Idx>,

Source§

type Output = <Keyed<K, Req, S> as RowField<Scope, Idx>>::Value

Source§

fn items(&self) -> Vec<SelectItem>

Source§

impl<K, Req, S: SqlType, Scope, Idx> SelectionPart<Scope, Idx> for Keyed<K, Req, S>
where Keyed<K, Req, S>: RowField<Scope, Idx>,

Source§

type Fields<Tail> = RowCons<<Keyed<K, Req, S> as RowKey>::Key, <Keyed<K, Req, S> as RowField<Scope, Idx>>::Value, Tail>

Source§

fn push_items(&self, out: &mut Vec<SelectItem>)

Auto Trait Implementations§

§

impl<K, Req, S> Freeze for Keyed<K, Req, S>

§

impl<K, Req, S> RefUnwindSafe for Keyed<K, Req, S>

§

impl<K, Req, S> Send for Keyed<K, Req, S>

§

impl<K, Req, S> Sync for Keyed<K, Req, S>

§

impl<K, Req, S> Unpin for Keyed<K, Req, S>

§

impl<K, Req, S> UnsafeUnpin for Keyed<K, Req, S>

§

impl<K, Req, S> UnwindSafe for Keyed<K, Req, S>

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<D, Scope, Req, Idxs, T> Condition<D, Scope, Idxs> for T
where Scope: Superset<Req, Idxs>, T: IntoExpr<Req = Req>, <T as IntoExpr>::Sql: BoolLike,

Source§

fn into_predicate(self) -> Predicate<D, Scope>

Source§

impl<T> ExprMethods for T
where T: IntoExpr,

Source§

fn eq<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: Comparable<Rhs::Sql>, Self::Req: Concat<Rhs::Req>,

Source§

fn ne<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: Comparable<Rhs::Sql>, Self::Req: Concat<Rhs::Req>,

Source§

fn lt<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: Comparable<Rhs::Sql>, Self::Req: Concat<Rhs::Req>,

Source§

fn lte<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: Comparable<Rhs::Sql>, Self::Req: Concat<Rhs::Req>,

Source§

fn gt<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: Comparable<Rhs::Sql>, Self::Req: Concat<Rhs::Req>,

Source§

fn gte<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: Comparable<Rhs::Sql>, Self::Req: Concat<Rhs::Req>,

Source§

fn is_null(self) -> Expr<Self::Req, Bool>

x IS NULL. Not expressible as .eq(..): comparing to NULL with = yields NULL, never true, so the two are different questions.
Source§

fn is_not_null(self) -> Expr<Self::Req, Bool>

Source§

fn and<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: BoolLike, Rhs::Sql: BoolLike, Self::Req: Concat<Rhs::Req>,

a AND b. The boolean requirement is on the method rather than on the receiver’s type, so every spelling a condition has — a comparison, a sql! fragment, a Nullable<Bool> column — combines with every other, the way .filter accepts them all.
Source§

fn or<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: BoolLike, Rhs::Sql: BoolLike, Self::Req: Concat<Rhs::Req>,

a OR b — see and.
Source§

fn like<Rhs: IntoExpr>( self, rhs: Rhs, ) -> Expr<<Self::Req as Concat<Rhs::Req>>::Output, Bool>
where Self::Sql: TextLike, Rhs::Sql: TextLike, Self::Req: Concat<Rhs::Req>,

x LIKE 'pattern'. The text requirement is on the method rather than on a trait of its own, so a non-text operand reports TextLike instead of a missing method.
Source§

fn is_in<I>(self, values: I) -> Expr<Self::Req, Bool>
where I: IntoIterator, I::Item: IntoExpr<Req = Nil>, Self::Sql: Comparable<<I::Item as IntoExpr>::Sql>,

x IN (a, b, ..) over a runtime-length list of literals, each bound as its own parameter. An empty list renders FALSE. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<Scope, Req, Idxs, T> GroupBy<Scope, Idxs> for T
where Scope: Superset<Req, Idxs>, T: IntoExpr<Req = Req>,

Source§

fn into_grouping(self) -> Grouping<Scope>

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> OrderExt for T
where T: IntoExpr,

Source§

fn asc(self) -> OrderKey<Self::Req>

Source§

fn sort(self, dir: SortDir) -> OrderKey<Self::Req>

The direction as a value, for a sort order that arrives at runtime — ?dir=desc — instead of an N-way match over .asc()/.desc().
Source§

fn desc(self) -> OrderKey<Self::Req>

Source§

impl<T> RawArg for T
where T: IntoExpr,

Source§

impl<S> Superset<Nil, Nil> for S

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

impl<T> WrapNullable<NotNull> for T