Skip to main content

A

Struct A 

Source
pub struct A<'inner, 'outer> { /* private fields */ }
Expand description

A struct allowing manipulation of an aggregation

§Lifetimes

The 'inner lifetime represents the lifetime of the query you are aggregating on. The 'outer lifetime represents the lifetime of the aggregation query being build.

The two are separate to ensure that any expression in the output table is either used in an aggregation function, or part of a group by clause.

Implementations§

Source§

impl<'inner, 'outer> A<'inner, 'outer>

Source

pub fn group_by<T: Table<'inner> + ForLifetimeTable>( &mut self, expr: T, ) -> T::WithLt<'outer>

Group the aggregation by the given table.

Source

pub fn array_agg<T: Table<'inner> + ForLifetimeTable>( &mut self, expr: T, ) -> ListTable<T::WithLt<'outer>>

Aggregate rows of the given table into an array

Source

pub fn avg<T: Table<'inner> + ForLifetimeTable>( &mut self, expr: T, ) -> T::WithLt<'outer>

Average the values of this table in the group.

Source

pub fn bit_and<T: Table<'inner> + ForLifetimeTable>( &mut self, expr: T, ) -> T::WithLt<'outer>

Bit and the values of this table in the group.

Source

pub fn bit_or<T: Table<'inner> + ForLifetimeTable>( &mut self, expr: T, ) -> T::WithLt<'outer>

Bit or the values of this table in the group.

Source

pub fn bit_xor<T: Table<'inner> + ForLifetimeTable>( &mut self, expr: T, ) -> T::WithLt<'outer>

Bit xor the values of this table in the group.

Source

pub fn bool_and<T: Table<'inner> + ForLifetimeTable>( &mut self, expr: T, ) -> T::WithLt<'outer>

Boolean and the values of this table in the group.

Source

pub fn bool_or<T: Table<'inner> + ForLifetimeTable>( &mut self, expr: T, ) -> T::WithLt<'outer>

Boolean or the values of this table in the group.

Source

pub fn count_star(&mut self) -> Expr<'outer, i32>

Count the number of rows in the group, including nulls.

Source

pub fn count<T>(&mut self, expr: Expr<'inner, T>) -> Expr<'outer, i32>

Count the number of rows in the group, excluding where the table is null.

Source

pub fn count_distinct<T>(&mut self, expr: Expr<'inner, T>) -> Expr<'outer, i32>

Count the distinct number of rows in the group, excluding where the table is null.

Source

pub fn max<T: Table<'inner> + ForLifetimeTable>( &mut self, expr: T, ) -> T::WithLt<'outer>

The maximum value of each column of this table in its group.

Source

pub fn min<T: Table<'inner> + ForLifetimeTable>( &mut self, expr: T, ) -> T::WithLt<'outer>

The minimum value of each column of this table in its group.

Source

pub fn sum<T: Table<'inner> + ForLifetimeTable>( &mut self, expr: T, ) -> T::WithLt<'outer>

The summation of the values of each column of this table in its group.

Auto Trait Implementations§

§

impl<'inner, 'outer> Freeze for A<'inner, 'outer>

§

impl<'inner, 'outer> !RefUnwindSafe for A<'inner, 'outer>

§

impl<'inner, 'outer> !Send for A<'inner, 'outer>

§

impl<'inner, 'outer> !Sync for A<'inner, 'outer>

§

impl<'inner, 'outer> Unpin for A<'inner, 'outer>

§

impl<'inner, 'outer> !UnwindSafe for A<'inner, 'outer>

Blanket Implementations§

Source§

impl<T> AliasSelf for T
where T: ?Sized,

Source§

type Alias = T

Always set to Self, but the type checker doesn’t reduce T::Alias to T.
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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T, U> IsEqual<U> for T
where T: AliasSelf<Alias = U> + ?Sized, U: ?Sized,