FlatMap

Trait FlatMap 

Source
pub trait FlatMap<O, E>: Sized {
    // Required methods
    fn flat_map_ok<U, F, O2>(self, _: F) -> FlatMapOk<Self, U, F> 
       where F: FnMut(O) -> U,
             U: IntoIterator<Item = O2>;
    fn flat_map_err<U, F, E2>(self, _: F) -> FlatMapErr<Self, U, F> 
       where F: FnMut(E) -> U,
             U: IntoIterator<Item = E2>;
}
Expand description

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

Required Methods§

Source

fn flat_map_ok<U, F, O2>(self, _: F) -> FlatMapOk<Self, U, F>
where F: FnMut(O) -> U, U: IntoIterator<Item = O2>,

Source

fn flat_map_err<U, F, E2>(self, _: F) -> FlatMapErr<Self, U, F>
where F: FnMut(E) -> U, U: IntoIterator<Item = 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> FlatMap<O, E> for I
where I: Iterator<Item = Result<O, E>> + Sized,