pub enum CommonFoldState {
Count(usize),
SumI64(i64),
Any(bool),
}Expand description
Unified state returned by CommonFold.
Variants§
Trait Implementations§
Source§impl Clone for CommonFoldState
impl Clone for CommonFoldState
Source§fn clone(&self) -> CommonFoldState
fn clone(&self) -> CommonFoldState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CommonFoldState
Source§impl Debug for CommonFoldState
impl Debug for CommonFoldState
impl Eq for CommonFoldState
Source§impl<L> Fold<L, CommonFoldState> for CommonFold<L>
impl<L> Fold<L, CommonFoldState> for CommonFold<L>
Source§fn reduce(
&self,
state: CommonFoldState,
entry: &L,
context: &FoldContext,
) -> CommonFoldState
fn reduce( &self, state: CommonFoldState, entry: &L, context: &FoldContext, ) -> CommonFoldState
Panics if state variant does not match self; use try_step for fallible version.
Source§fn init(&self, _context: &FoldContext) -> CommonFoldState
fn init(&self, _context: &FoldContext) -> CommonFoldState
Get the initial state before any entries are processed.
Source§fn finalize(&self, state: S, _context: &FoldContext) -> S
fn finalize(&self, state: S, _context: &FoldContext) -> S
Finalize the state after all entries are processed; default returns state unchanged.
Source§fn derive<'a, I>(&self, entries: I, context: &FoldContext) -> FoldOutcome<S>
fn derive<'a, I>(&self, entries: I, context: &FoldContext) -> FoldOutcome<S>
Derive state from an iterator of entries.
Source§fn derive_filtered<'a, I, F>(
&self,
entries: I,
context: &FoldContext,
filter: F,
) -> FoldOutcome<S>
fn derive_filtered<'a, I, F>( &self, entries: I, context: &FoldContext, filter: F, ) -> FoldOutcome<S>
Derive state with a filter.
Source§impl PartialEq for CommonFoldState
impl PartialEq for CommonFoldState
Source§fn eq(&self, other: &CommonFoldState) -> bool
fn eq(&self, other: &CommonFoldState) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CommonFoldState
Source§impl<L> TryFold<L, CommonFoldState> for CommonFold<L>
impl<L> TryFold<L, CommonFoldState> for CommonFold<L>
Source§fn try_step(
&self,
state: CommonFoldState,
entry: &L,
context: &FoldContext,
) -> Result<CommonFoldState, FoldFailure>
fn try_step( &self, state: CommonFoldState, entry: &L, context: &FoldContext, ) -> Result<CommonFoldState, FoldFailure>
Process a single entry and return an error instead of panicking.
Auto Trait Implementations§
impl Freeze for CommonFoldState
impl RefUnwindSafe for CommonFoldState
impl Send for CommonFoldState
impl Sync for CommonFoldState
impl Unpin for CommonFoldState
impl UnsafeUnpin for CommonFoldState
impl UnwindSafe for CommonFoldState
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