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>
impl<'inner, 'outer> A<'inner, 'outer>
Sourcepub fn group_by<T: Table<'inner> + ForLifetimeTable>(
&mut self,
expr: T,
) -> T::WithLt<'outer>
pub fn group_by<T: Table<'inner> + ForLifetimeTable>( &mut self, expr: T, ) -> T::WithLt<'outer>
Group the aggregation by the given table.
Sourcepub fn array_agg<T: Table<'inner> + ForLifetimeTable>(
&mut self,
expr: T,
) -> ListTable<T::WithLt<'outer>>
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
Sourcepub fn avg<T: Table<'inner> + ForLifetimeTable>(
&mut self,
expr: T,
) -> T::WithLt<'outer>
pub fn avg<T: Table<'inner> + ForLifetimeTable>( &mut self, expr: T, ) -> T::WithLt<'outer>
Average the values of this table in the group.
Sourcepub fn bit_and<T: Table<'inner> + ForLifetimeTable>(
&mut self,
expr: T,
) -> T::WithLt<'outer>
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.
Sourcepub fn bit_or<T: Table<'inner> + ForLifetimeTable>(
&mut self,
expr: T,
) -> T::WithLt<'outer>
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.
Sourcepub fn bit_xor<T: Table<'inner> + ForLifetimeTable>(
&mut self,
expr: T,
) -> T::WithLt<'outer>
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.
Sourcepub fn bool_and<T: Table<'inner> + ForLifetimeTable>(
&mut self,
expr: T,
) -> T::WithLt<'outer>
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.
Sourcepub fn bool_or<T: Table<'inner> + ForLifetimeTable>(
&mut self,
expr: T,
) -> T::WithLt<'outer>
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.
Sourcepub fn count_star(&mut self) -> Expr<'outer, i32>
pub fn count_star(&mut self) -> Expr<'outer, i32>
Count the number of rows in the group, including nulls.
Sourcepub fn count<T>(&mut self, expr: Expr<'inner, T>) -> Expr<'outer, i32>
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.
Sourcepub fn count_distinct<T>(&mut self, expr: Expr<'inner, T>) -> Expr<'outer, i32>
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.
Sourcepub fn max<T: Table<'inner> + ForLifetimeTable>(
&mut self,
expr: T,
) -> T::WithLt<'outer>
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.
Sourcepub fn min<T: Table<'inner> + ForLifetimeTable>(
&mut self,
expr: T,
) -> T::WithLt<'outer>
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.
Sourcepub fn sum<T: Table<'inner> + ForLifetimeTable>(
&mut self,
expr: T,
) -> T::WithLt<'outer>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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