pub trait TryFold<L, S>: Fold<L, S> {
// Required method
fn try_step(
&self,
state: S,
entry: &L,
context: &FoldContext,
) -> Result<S, FoldFailure>;
}Expand description
Fallible fold step API for reducers that can reject invalid state shapes.
Required Methods§
Sourcefn try_step(
&self,
state: S,
entry: &L,
context: &FoldContext,
) -> Result<S, FoldFailure>
fn try_step( &self, state: S, entry: &L, context: &FoldContext, ) -> Result<S, FoldFailure>
Process a single entry and return an error instead of panicking.