pub struct Aggregate<N, K, L, W, WV, A>{
pub items: usize,
pub names: BTreeMap<N, usize>,
pub kinds: BTreeMap<K, usize>,
pub labels: BTreeMap<L, usize>,
pub weights: BTreeMap<W, WV>,
pub annotations: BTreeMap<A, usize>,
}Expand description
Metadata aggregate values.
Fields§
§items: usizeOver how many items the aggregate has been taken.
names: BTreeMap<N, usize>Name occurrence.
kinds: BTreeMap<K, usize>Kind occurrence.
labels: BTreeMap<L, usize>Label occurrence.
weights: BTreeMap<W, WV>Weight sum value.
annotations: BTreeMap<A, usize>Annotation key occurrence.
Implementations§
Source§impl<N, K, L, W, WV, A> Aggregate<N, K, L, W, WV, A>
impl<N, K, L, W, WV, A> Aggregate<N, K, L, W, WV, A>
Sourcepub fn builder() -> AggregateBuilder<N, K, L, W, WV, A>
pub fn builder() -> AggregateBuilder<N, K, L, W, WV, A>
Create an instance of Aggregate using the builder syntax
Source§impl<N, K, L, W, WV, A> Aggregate<N, K, L, W, WV, A>
impl<N, K, L, W, WV, A> Aggregate<N, K, L, W, WV, A>
Sourcepub fn add<'a, M: ReadMetadata<'a, N, K, L, W, WV, A, AV>, AV: 'a + AnnotationValue>(
&'a mut self,
item: &'a M,
)
pub fn add<'a, M: ReadMetadata<'a, N, K, L, W, WV, A, AV>, AV: 'a + AnnotationValue>( &'a mut self, item: &'a M, )
Add metadata to the aggregate.
Sourcepub fn subtract<'a, M: ReadMetadata<'a, N, K, L, W, WV, A, AV>, AV: 'a + AnnotationValue>(
&'a mut self,
item: &'a M,
)
pub fn subtract<'a, M: ReadMetadata<'a, N, K, L, W, WV, A, AV>, AV: 'a + AnnotationValue>( &'a mut self, item: &'a M, )
Subtract metadata from the aggregate.
Sourcepub fn aggregate(&self, aggregator: &Aggregator<N, K, L, W, A>) -> f64
pub fn aggregate(&self, aggregator: &Aggregator<N, K, L, W, A>) -> f64
Get the sum for all given fields’ values for a given aggregator.
Sourcepub fn fraction(&self, aggregator: &Aggregator<N, K, L, W, A>) -> f64
pub fn fraction(&self, aggregator: &Aggregator<N, K, L, W, A>) -> f64
Get a fraction that a field represents with respect to the sum of all fields for a certain aggregator.
Trait Implementations§
Source§impl<'de, N, K, L, W, WV, A> Deserialize<'de> for Aggregate<N, K, L, W, WV, A>where
N: Field + Deserialize<'de>,
K: Field + Deserialize<'de>,
L: Field + Deserialize<'de>,
W: Field + Deserialize<'de>,
WV: WeightValue + Deserialize<'de>,
A: Field + Deserialize<'de>,
Aggregate<N, K, L, W, WV, A>: Default,
impl<'de, N, K, L, W, WV, A> Deserialize<'de> for Aggregate<N, K, L, W, WV, A>where
N: Field + Deserialize<'de>,
K: Field + Deserialize<'de>,
L: Field + Deserialize<'de>,
W: Field + Deserialize<'de>,
WV: WeightValue + Deserialize<'de>,
A: Field + Deserialize<'de>,
Aggregate<N, K, L, W, WV, A>: Default,
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<N, K, L, W, WV, A> PartialEq for Aggregate<N, K, L, W, WV, A>
impl<N, K, L, W, WV, A> PartialEq for Aggregate<N, K, L, W, WV, A>
impl<N, K, L, W, WV, A> StructuralPartialEq for Aggregate<N, K, L, W, WV, A>
Auto Trait Implementations§
impl<N, K, L, W, WV, A> Freeze for Aggregate<N, K, L, W, WV, A>
impl<N, K, L, W, WV, A> RefUnwindSafe for Aggregate<N, K, L, W, WV, A>where
N: RefUnwindSafe,
K: RefUnwindSafe,
L: RefUnwindSafe,
W: RefUnwindSafe,
WV: RefUnwindSafe,
A: RefUnwindSafe,
impl<N, K, L, W, WV, A> Send for Aggregate<N, K, L, W, WV, A>
impl<N, K, L, W, WV, A> Sync for Aggregate<N, K, L, W, WV, A>
impl<N, K, L, W, WV, A> Unpin for Aggregate<N, K, L, W, WV, A>
impl<N, K, L, W, WV, A> UnsafeUnpin for Aggregate<N, K, L, W, WV, A>
impl<N, K, L, W, WV, A> UnwindSafe for Aggregate<N, K, L, W, WV, A>where
N: RefUnwindSafe,
K: RefUnwindSafe,
L: RefUnwindSafe,
W: RefUnwindSafe,
WV: RefUnwindSafe,
A: RefUnwindSafe,
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