pub struct RelationshipAggregates<R> {
pub values: Vec<(String, Value)>,
/* private fields */
}Expand description
The aggregates a row’s query asked for in related, by relationship:
related(Issue::COMMENTS, |q| q.count()) gives
issue.aggregates.count(Issue::COMMENTS). The relationship’s own field
stays None.
Fields§
§values: Vec<(String, Value)>The values by relationship name.
Implementations§
Source§impl<R> RelationshipAggregates<R>
impl<R> RelationshipAggregates<R>
Sourcepub fn from_entry(entry: &ViewEntry) -> Self
pub fn from_entry(entry: &ViewEntry) -> Self
The aggregates of entry’s relationships, for generated
from_entrys.
Sourcepub fn count<D>(&self, relationship: Relationship<R, D>) -> Option<i64>
pub fn count<D>(&self, relationship: Relationship<R, D>) -> Option<i64>
The count() of a relationship; None when the query didn’t ask
for it.
Sourcepub fn sum<D>(&self, relationship: Relationship<R, D>) -> Option<f64>
pub fn sum<D>(&self, relationship: Relationship<R, D>) -> Option<f64>
The sum of a relationship; None when the query didn’t ask for it
or it has no rows.
Sourcepub fn avg<D>(&self, relationship: Relationship<R, D>) -> Option<f64>
pub fn avg<D>(&self, relationship: Relationship<R, D>) -> Option<f64>
The avg of a relationship; None when the query didn’t ask for it
or it has no rows.
Sourcepub fn value<V: ZeroValue, D>(
&self,
relationship: Relationship<R, D>,
) -> Option<V>
pub fn value<V: ZeroValue, D>( &self, relationship: Relationship<R, D>, ) -> Option<V>
The aggregate of a relationship read as V, as for min and max;
None when the query didn’t ask for it, it’s null, or it isn’t a
V.
Trait Implementations§
Source§impl<R> Clone for RelationshipAggregates<R>
impl<R> Clone for RelationshipAggregates<R>
Source§impl<R> Debug for RelationshipAggregates<R>
impl<R> Debug for RelationshipAggregates<R>
Source§impl<R> Default for RelationshipAggregates<R>
impl<R> Default for RelationshipAggregates<R>
Auto Trait Implementations§
impl<R> Forget for RelationshipAggregates<R>
impl<R> Freeze for RelationshipAggregates<R>
impl<R> Move for RelationshipAggregates<R>
impl<R> RefUnwindSafe for RelationshipAggregates<R>
impl<R> Send for RelationshipAggregates<R>
impl<R> Sync for RelationshipAggregates<R>
impl<R> Unpin for RelationshipAggregates<R>
impl<R> UnsafeUnpin for RelationshipAggregates<R>
impl<R> UnwindSafe for RelationshipAggregates<R>
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