Struct ratio_graph::metadata::Aggregate
source · pub struct Aggregate {
pub items: isize,
pub kinds: HashMap<String, isize>,
pub labels: HashMap<String, isize>,
pub weights: HashMap<String, f64>,
pub annotations: HashMap<String, isize>,
}Fields§
§items: isizeOver how many items the aggregate has been taken.
kinds: HashMap<String, isize>Kind occurrence.
labels: HashMap<String, isize>Label occurrence.
weights: HashMap<String, f64>Weight sum value.
annotations: HashMap<String, isize>Annotation key occurrence.
Implementations§
source§impl Aggregate
impl Aggregate
pub fn new(data: &[&Metadata]) -> Self
sourcepub fn sum(
&self,
aggregator: &Aggregator,
fields: Option<&HashSet<String>>
) -> f64
pub fn sum( &self, aggregator: &Aggregator, fields: Option<&HashSet<String>> ) -> f64
Get the sum for all given fields’ values for a given aggregator.
sourcepub fn value(&self, aggregator: &Aggregator, field: &String) -> f64
pub fn value(&self, aggregator: &Aggregator, field: &String) -> f64
Get the value that a field represents for a certain aggregator.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Aggregate
impl<'de> Deserialize<'de> for Aggregate
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<Aggregate> for Aggregate
impl PartialEq<Aggregate> for Aggregate
impl StructuralPartialEq for Aggregate
Auto Trait Implementations§
impl RefUnwindSafe for Aggregate
impl Send for Aggregate
impl Sync for Aggregate
impl Unpin for Aggregate
impl UnwindSafe for Aggregate
Blanket Implementations§
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.