pub struct AvgState {
pub sum: f64,
pub count: u64,
}Expand description
AVG state — pair (sum, count). Final value is sum / count.
Fields§
§sum: f64§count: u64Implementations§
Trait Implementations§
impl Copy for AvgState
Source§impl SpillCodec for AvgState
impl SpillCodec for AvgState
Source§fn encode<W: Write>(&self, w: &mut W) -> Result<usize, SpillError>
fn encode<W: Write>(&self, w: &mut W) -> Result<usize, SpillError>
Encode
self into the writer. Returns the number of bytes
written so the caller can track per-batch size.Source§fn decode<R: Read>(r: &mut R) -> Result<Option<Self>, SpillError>
fn decode<R: Read>(r: &mut R) -> Result<Option<Self>, SpillError>
Decode a fresh value from the reader. Reads exactly one
element; returns
Ok(None) on a clean end-of-file so
drain loops can terminate naturally.Source§fn decode_with_budget<R: Read>(
r: &mut R,
_budget: &mut SpillDecodeBudget,
) -> Result<Option<Self>, SpillError>
fn decode_with_budget<R: Read>( r: &mut R, _budget: &mut SpillDecodeBudget, ) -> Result<Option<Self>, SpillError>
Implementations must admit heap allocations before reserving them. The
drain path refuses legacy codecs without a bounded implementation.
Auto Trait Implementations§
impl Forget for AvgState
impl Freeze for AvgState
impl RefUnwindSafe for AvgState
impl Send for AvgState
impl Sync for AvgState
impl Unpin for AvgState
impl UnsafeUnpin for AvgState
impl UnwindSafe for AvgState
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request