Trait sbp::sbp_iter_ext::SbpIterExt
source · [−]pub trait SbpIterExt: Iterator {
fn ignore_errors<'a>(self) -> HandleErrorsIter<'a, Self, DeserializeError>ⓘNotable traits for HandleErrorsIter<'a, I, E>impl<'a, I, E> Iterator for HandleErrorsIter<'a, I, E> where
I: Iterator<Item = Result<Sbp, E>>, type Item = Sbp;
where
Self: Iterator<Item = Result<Sbp, DeserializeError>> + Sized,
{ ... }
fn log_errors<'a>(
self,
level: Level
) -> HandleErrorsIter<'a, Self, DeserializeError>ⓘNotable traits for HandleErrorsIter<'a, I, E>impl<'a, I, E> Iterator for HandleErrorsIter<'a, I, E> where
I: Iterator<Item = Result<Sbp, E>>, type Item = Sbp;
where
Self: Iterator<Item = Result<Sbp, DeserializeError>> + Sized,
{ ... }
fn handle_errors<'a, E, F>(self, on_err: F) -> HandleErrorsIter<'a, Self, E>ⓘNotable traits for HandleErrorsIter<'a, I, E>impl<'a, I, E> Iterator for HandleErrorsIter<'a, I, E> where
I: Iterator<Item = Result<Sbp, E>>, type Item = Sbp;
where
Self: Iterator<Item = Result<Sbp, E>> + Sized,
F: FnMut(&E) -> ControlFlow + 'a,
{ ... }
}
Expand description
Provided methods
fn ignore_errors<'a>(self) -> HandleErrorsIter<'a, Self, DeserializeError>ⓘNotable traits for HandleErrorsIter<'a, I, E>impl<'a, I, E> Iterator for HandleErrorsIter<'a, I, E> where
I: Iterator<Item = Result<Sbp, E>>, type Item = Sbp;
where
Self: Iterator<Item = Result<Sbp, DeserializeError>> + Sized,
fn ignore_errors<'a>(self) -> HandleErrorsIter<'a, Self, DeserializeError>ⓘNotable traits for HandleErrorsIter<'a, I, E>impl<'a, I, E> Iterator for HandleErrorsIter<'a, I, E> where
I: Iterator<Item = Result<Sbp, E>>, type Item = Sbp;
where
Self: Iterator<Item = Result<Sbp, DeserializeError>> + Sized,
I: Iterator<Item = Result<Sbp, E>>, type Item = Sbp;
Lift an Iterator<Item = Result<Sbp>>
into an Iterator<Item = Sbp>
by ignoring all the errors.
The iterator will terminate if an io error is encountered.
fn log_errors<'a>(
self,
level: Level
) -> HandleErrorsIter<'a, Self, DeserializeError>ⓘNotable traits for HandleErrorsIter<'a, I, E>impl<'a, I, E> Iterator for HandleErrorsIter<'a, I, E> where
I: Iterator<Item = Result<Sbp, E>>, type Item = Sbp;
where
Self: Iterator<Item = Result<Sbp, DeserializeError>> + Sized,
fn log_errors<'a>(
self,
level: Level
) -> HandleErrorsIter<'a, Self, DeserializeError>ⓘNotable traits for HandleErrorsIter<'a, I, E>impl<'a, I, E> Iterator for HandleErrorsIter<'a, I, E> where
I: Iterator<Item = Result<Sbp, E>>, type Item = Sbp;
where
Self: Iterator<Item = Result<Sbp, DeserializeError>> + Sized,
I: Iterator<Item = Result<Sbp, E>>, type Item = Sbp;
Lift an Iterator<Item = Result<Sbp>>
into an Iterator<Item = Sbp>
by logging all the errors.
The iterator will terminate if an io error is encountered.
fn handle_errors<'a, E, F>(self, on_err: F) -> HandleErrorsIter<'a, Self, E>ⓘNotable traits for HandleErrorsIter<'a, I, E>impl<'a, I, E> Iterator for HandleErrorsIter<'a, I, E> where
I: Iterator<Item = Result<Sbp, E>>, type Item = Sbp;
where
Self: Iterator<Item = Result<Sbp, E>> + Sized,
F: FnMut(&E) -> ControlFlow + 'a,
fn handle_errors<'a, E, F>(self, on_err: F) -> HandleErrorsIter<'a, Self, E>ⓘNotable traits for HandleErrorsIter<'a, I, E>impl<'a, I, E> Iterator for HandleErrorsIter<'a, I, E> where
I: Iterator<Item = Result<Sbp, E>>, type Item = Sbp;
where
Self: Iterator<Item = Result<Sbp, E>> + Sized,
F: FnMut(&E) -> ControlFlow + 'a,
I: Iterator<Item = Result<Sbp, E>>, type Item = Sbp;
Lift an Iterator<Item = Result<Sbp>>
into an Iterator<Item = Sbp>
with a custom error handler.
You can use (ControlFlow)self::ControlFlow to determine if the iterator should continue or break on error.