Map

Trait Map 

Source
pub trait Map<O, E>: Sized {
    // Required methods
    fn map_ok<F, O2>(self, _: F) -> MapOk<Self, F> 
       where F: FnMut(O) -> O2;
    fn map_err<F, E2>(self, _: F) -> MapErr<Self, F> 
       where F: FnMut(E) -> E2;
}
Expand description

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

Required Methods§

Source

fn map_ok<F, O2>(self, _: F) -> MapOk<Self, F>
where F: FnMut(O) -> O2,

Source

fn map_err<F, E2>(self, _: F) -> MapErr<Self, F>
where F: FnMut(E) -> 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> Map<O, E> for I
where I: Iterator<Item = Result<O, E>> + Sized,