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 moreSource§impl Debug for CommonFoldState
impl Debug for CommonFoldState
Source§impl<L> Fold<L, CommonFoldState> for CommonFold<L>
impl<L> Fold<L, CommonFoldState> for CommonFold<L>
Source§fn step(
&self,
state: CommonFoldState,
entry: &L,
context: &FoldContext,
) -> CommonFoldState
fn step( &self, state: CommonFoldState, entry: &L, context: &FoldContext, ) -> CommonFoldState
§Panics
Panics if state does not match the variant expected by self.
Use TryFold::try_step to handle the mismatch as an error instead.
Source§fn initial(&self, _context: &FoldContext) -> CommonFoldState
fn initial(&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. Read more
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. Read more
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 ==.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.
impl Copy for CommonFoldState
impl Eq for CommonFoldState
impl StructuralPartialEq for CommonFoldState
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