pub struct SumI64Fold<L> { /* private fields */ }Expand description
A zero-allocation i64 summation fold with a function-pointer projection.
Implementations§
Trait Implementations§
Source§impl<L: Clone> Clone for SumI64Fold<L>
impl<L: Clone> Clone for SumI64Fold<L>
Source§fn clone(&self) -> SumI64Fold<L>
fn clone(&self) -> SumI64Fold<L>
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<L> Debug for SumI64Fold<L>
impl<L> Debug for SumI64Fold<L>
Source§impl<L> Fold<L, i64> for SumI64Fold<L>
impl<L> Fold<L, i64> for SumI64Fold<L>
Source§fn initial(&self, _context: &FoldContext) -> i64
fn initial(&self, _context: &FoldContext) -> i64
Get the initial state before any entries are processed.
Source§fn step(&self, state: i64, entry: &L, _context: &FoldContext) -> i64
fn step(&self, state: i64, entry: &L, _context: &FoldContext) -> i64
Process a single entry and return the new state. Read more
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<L> TryFold<L, i64> for SumI64Fold<L>
impl<L> TryFold<L, i64> for SumI64Fold<L>
Source§fn try_step(
&self,
state: i64,
entry: &L,
context: &FoldContext,
) -> Result<i64, FoldFailure>
fn try_step( &self, state: i64, entry: &L, context: &FoldContext, ) -> Result<i64, FoldFailure>
Process a single entry and return an error instead of panicking.
impl<L: Copy> Copy for SumI64Fold<L>
Auto Trait Implementations§
impl<L> Freeze for SumI64Fold<L>
impl<L> RefUnwindSafe for SumI64Fold<L>
impl<L> Send for SumI64Fold<L>
impl<L> Sync for SumI64Fold<L>
impl<L> Unpin for SumI64Fold<L>
impl<L> UnsafeUnpin for SumI64Fold<L>
impl<L> UnwindSafe for SumI64Fold<L>
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