Trait sbp::sbp_iter_ext::SbpIterExt

source ·
pub trait SbpIterExt: Iterator {
    // Provided methods
    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 { ... }
    fn with_rover_time<T>(self) -> RoverTimeIter<Self>
       where T: HasTime,
             Self: Iterator<Item = T> + Sized { ... }
}
Expand description

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

Provided Methods§

source

fn ignore_errors<'a>(self) -> HandleErrorsIter<'a, Self, DeserializeError>
where Self: Iterator<Item = Result<Sbp, DeserializeError>> + Sized,

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.

source

fn log_errors<'a>( self, level: Level ) -> HandleErrorsIter<'a, Self, DeserializeError>
where Self: Iterator<Item = Result<Sbp, DeserializeError>> + Sized,

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.

source

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,

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.

source

fn with_rover_time<T>(self) -> RoverTimeIter<Self>
where T: HasTime, Self: Iterator<Item = T> + Sized,

Return an iterable that also includes [GpsTime]s. This method calls [SbpMessage::gps_time] on each message. If the message has a complete GpsTime it is returned. If the message only has a TOW, this itertor will use the last week number it has seen, or return None if it hasn’t seen any.

Implementors§

source§

impl<I> SbpIterExt for I
where I: Iterator + Sized,