pub enum AggregateFunction {
Count(Option<String>),
Sum(String),
Avg(String),
Min(String),
Max(String),
}Expand description
An aggregate function applied to a column in a query.
Each variant maps to a SQL aggregate (COUNT, SUM, AVG, MIN, MAX).
All variants except AggregateFunction::Count take the name of the
column to aggregate over.
Variants§
Count(Option<String>)
Count rows in the group.
None is equivalent to COUNT(*) and counts every row.
Some(column) is equivalent to COUNT(column) and counts only rows
where column is non-null.
Sum(String)
Sum the values of the given column (SUM(column)).
Avg(String)
Arithmetic mean of the given column (AVG(column)).
Min(String)
Minimum value of the given column (MIN(column)).
Max(String)
Maximum value of the given column (MAX(column)).
Trait Implementations§
Source§impl Clone for AggregateFunction
impl Clone for AggregateFunction
Source§fn clone(&self) -> AggregateFunction
fn clone(&self) -> AggregateFunction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AggregateFunction
impl Debug for AggregateFunction
Source§impl<'de> Deserialize<'de> for AggregateFunction
impl<'de> Deserialize<'de> for AggregateFunction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AggregateFunction
impl PartialEq for AggregateFunction
Source§impl Serialize for AggregateFunction
impl Serialize for AggregateFunction
impl Eq for AggregateFunction
impl StructuralPartialEq for AggregateFunction
Auto Trait Implementations§
impl Freeze for AggregateFunction
impl RefUnwindSafe for AggregateFunction
impl Send for AggregateFunction
impl Sync for AggregateFunction
impl Unpin for AggregateFunction
impl UnsafeUnpin for AggregateFunction
impl UnwindSafe for AggregateFunction
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
Mutably borrows from an owned value. Read more