Trait sbp::SbpIterExt

source ·
pub trait SbpIterExt: Iterator {
    fn ignore_errors<'a>(self) -> HandleErrorsIter<'a, Self, DeserializeError> 
    where
        Self: Iterator<Item = Result<Sbp, DeserializeError>> + Sized
, { ... } fn log_errors<'a>(
        self,
        level: Level
    ) -> HandleErrorsIter<'a, Self, DeserializeError>
    where
        Self: Iterator<Item = Result<Sbp, DeserializeError>> + Sized
, { ... } fn handle_errors<'a, E, F>(self, on_err: F) -> HandleErrorsIter<'a, Self, E>
    where
        Self: Iterator<Item = Result<Sbp, E>> + Sized,
        F: FnMut(&E) -> ControlFlow + 'a
, { ... } }
Expand description

An Iterator blanket implementation that provides extra adaptors for iterators of Sbp messages.

Provided Methods§

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.

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.

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.

Implementors§