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