pub trait ErrorCollector<E> {
type Collection;
// Required methods
fn empty() -> Self;
fn push_err(&mut self, err: E) -> ControlFlow;
fn with_value<T>(self, val: T) -> Result<T, Self::Collection>;
}Expand description
Determines the manner in which the encountered error(s) are processed, stored and returned, as well as whether the iteration should continue or not.
Required Associated Types§
Sourcetype Collection
type Collection
The type to be returned after the iteration has been stopped
Required Methods§
Sourcefn push_err(&mut self, err: E) -> ControlFlow
fn push_err(&mut self, err: E) -> ControlFlow
Processes an error. Returns an ControlFlow type indicating whether the iteration shall stop
or not.
Sourcefn with_value<T>(self, val: T) -> Result<T, Self::Collection>
fn with_value<T>(self, val: T) -> Result<T, Self::Collection>
Returns Ok(val) if the iteration run to completion, or an error collection of type
Self::Collection if error(s) were encountered.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.