resiter::filter_map

Trait FilterMap

Source
pub trait FilterMap<O, E>: Sized {
    // Required methods
    fn filter_map_ok<F, O2>(self, _: F) -> FilterMapOk<Self, F> 
       where F: FnMut(O) -> Option<O2>;
    fn filter_map_err<F, E2>(self, _: F) -> FilterMapErr<Self, F> 
       where F: FnMut(E) -> Option<E2>;
}
Expand description

Extension trait for Iterator<Item = Result<O, E>> to selectively transform and map Oks and Errors.

Required Methods§

Source

fn filter_map_ok<F, O2>(self, _: F) -> FilterMapOk<Self, F>
where F: FnMut(O) -> Option<O2>,

Source

fn filter_map_err<F, E2>(self, _: F) -> FilterMapErr<Self, F>
where F: FnMut(E) -> Option<E2>,

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.

Implementors§

Source§

impl<I, O, E> FilterMap<O, E> for I
where I: Iterator<Item = Result<O, E>> + Sized,