pub struct Avg<T, R> { /* private fields */ }Expand description
Representation of a partially computed average aggregate as a (sum, count)
tuple.
This struct represents the result of the linear part of the average
aggregate as a (sum, count) tuple (see Stream::dyn_average). The
actual average value can be obtained by dividing sum by count. Avg
forms a commutative monoid with point-wise plus operation (sum1, count1) + (sum2, count2) = (sum1 + sum2, count1 + count2).
Implementations§
Trait Implementations§
Source§impl<T, R> AddAssignByRef for Avg<T, R>where
T: AddAssignByRef,
R: AddAssignByRef,
impl<T, R> AddAssignByRef for Avg<T, R>where
T: AddAssignByRef,
R: AddAssignByRef,
fn add_assign_by_ref(&mut self, rhs: &Self)
Source§impl<T, R> Archive for Avg<T, R>
impl<T, R> Archive for Avg<T, R>
impl<T: Eq, R: Eq> Eq for Avg<T, R>
Source§impl<T, R> IsNone for Avg<T, R>
impl<T, R> IsNone for Avg<T, R>
Source§impl<T: Ord, R: Ord> Ord for Avg<T, R>
impl<T: Ord, R: Ord> Ord for Avg<T, R>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialOrd, R: PartialOrd> PartialOrd for Avg<T, R>
impl<T: PartialOrd, R: PartialOrd> PartialOrd for Avg<T, R>
Source§impl<T, R> SizeOf for Avg<T, R>
impl<T, R> SizeOf for Avg<T, R>
Source§fn size_of_children(&self, context: &mut Context)
fn size_of_children(&self, context: &mut Context)
Gets the size of all “children” owned by this value, not including the
size of the value itself. Read more
Source§fn size_of_with_context(&self, context: &mut Context)
fn size_of_with_context(&self, context: &mut Context)
Adds the size of the current value to the given
Context,
including both the size of the value itself and all of its childrenimpl<T, R> StructuralPartialEq for Avg<T, R>
Source§impl<T, R> SupportsRoaring for Avg<T, R>
impl<T, R> SupportsRoaring for Avg<T, R>
Source§fn supports_roaring32(&self) -> bool
fn supports_roaring32(&self) -> bool
Returns
true if this key type can be represented in a 32-bit roaring
bitmap.Source§fn roaring_u32_offset_dyn_checked(&self, min: &DynData) -> u32
fn roaring_u32_offset_dyn_checked(&self, min: &DynData) -> u32
Like
roaring_u32_offset_dyn, but
panics when the offset cannot be computed.Auto Trait Implementations§
impl<T, R> Freeze for Avg<T, R>
impl<T, R> RefUnwindSafe for Avg<T, R>where
T: RefUnwindSafe,
R: RefUnwindSafe,
impl<T, R> Send for Avg<T, R>
impl<T, R> Sync for Avg<T, R>
impl<T, R> Unpin for Avg<T, R>
impl<T, R> UnsafeUnpin for Avg<T, R>where
T: UnsafeUnpin,
R: UnsafeUnpin,
impl<T, R> UnwindSafe for Avg<T, R>where
T: UnwindSafe,
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
The archived counterpart of this type. Unlike
Archive, it may be unsized. Read moreSource§type MetadataResolver = ()
type MetadataResolver = ()
The resolver for the metadata of this type. Read more
Source§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata,
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata, )
Creates the archived version of the metadata for this value at the given position and writes
it to the given output. Read more
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
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Comparable for T
impl<T> Comparable for T
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DBData for Twhere
T: Default + Clone + Eq + Ord + Hash + SizeOf + Send + Sync + Debug + ArchivedDBData + IsNone + SupportsRoaring + 'static,
<T as IsNone>::Inner: ArchivedDBData,
impl<T> DBWeight for Twhere
T: DBData + MonoidValue,
Source§impl<T> Data for Twhere
T: DBData,
impl<T> Data for Twhere
T: DBData,
Source§fn default_hash(&self) -> u64
fn default_hash(&self) -> u64
Compute a hash of the object using default hasher and seed.
fn dyn_hash(&self, hasher: &mut dyn Hasher)
Source§fn as_data(&self) -> &(dyn Data + 'static)
fn as_data(&self) -> &(dyn Data + 'static)
Cast any type that implements this trait to
&dyn Data. Read moreSource§fn as_data_mut(&mut self) -> &mut (dyn Data + 'static)
fn as_data_mut(&mut self) -> &mut (dyn Data + 'static)
Cast any type that implements this trait to
&mut dyn Data. Read moreimpl<T> Data for Twhere
T: Clone + 'static,
Source§impl<T> DeserializableDyn for Twhere
T: ArchivedDBData,
impl<T> DeserializableDyn for Twhere
T: ArchivedDBData,
Source§unsafe fn deserialize_from_bytes_with(
&mut self,
bytes: &[u8],
pos: usize,
deserializer: &mut Deserializer,
)
unsafe fn deserialize_from_bytes_with( &mut self, bytes: &[u8], pos: usize, deserializer: &mut Deserializer, )
Deserialize
self from the given slice and offset. Read moreSource§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<V> Erase<dyn Data> for V
impl<V> Erase<dyn Data> for V
Source§fn erase(&self) -> &(dyn Data + 'static)
fn erase(&self) -> &(dyn Data + 'static)
Convert a reference to
self into a reference to Trait.Source§fn erase_mut(&mut self) -> &mut (dyn Data + 'static)
fn erase_mut(&mut self) -> &mut (dyn Data + 'static)
Convert a mutable reference to
self into a mutable reference to Trait.Source§fn erase_archived(
archived: &<V as Archive>::Archived,
) -> &<dyn Data as ArchiveTrait>::Archived
fn erase_archived( archived: &<V as Archive>::Archived, ) -> &<dyn Data as ArchiveTrait>::Archived
Convert a reference to an archived representation of
Self into a reference
to a trait object of type Trait::Archived.Source§impl<V> Erase<dyn Weight> for V
impl<V> Erase<dyn Weight> for V
Source§fn erase(&self) -> &(dyn Weight + 'static)
fn erase(&self) -> &(dyn Weight + 'static)
Convert a reference to
self into a reference to Trait.Source§fn erase_mut(&mut self) -> &mut (dyn Weight + 'static)
fn erase_mut(&mut self) -> &mut (dyn Weight + 'static)
Convert a mutable reference to
self into a mutable reference to Trait.Source§fn erase_archived(
archived: &<V as Archive>::Archived,
) -> &<dyn Weight as ArchiveTrait>::Archived
fn erase_archived( archived: &<V as Archive>::Archived, ) -> &<dyn Weight as ArchiveTrait>::Archived
Convert a reference to an archived representation of
Self into a reference
to a trait object of type Trait::Archived.impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> GroupValue for 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>
Converts
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>
Converts
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.