Filter

Trait Filter 

Source
pub trait Filter<O, E>: Sized {
    // Required methods
    fn filter_ok<F>(self, _: F) -> FilterOk<Self, F> 
       where F: FnMut(&O) -> bool;
    fn filter_err<F>(self, _: F) -> FilterErr<Self, F> 
       where F: FnMut(&E) -> bool;
}
Expand description

Extension trait for Iterator<Item = Result<O, E>> to filter one kind of result (and leaving the other as is)

Required Methods§

Source

fn filter_ok<F>(self, _: F) -> FilterOk<Self, F>
where F: FnMut(&O) -> bool,

Source

fn filter_err<F>(self, _: F) -> FilterErr<Self, F>
where F: FnMut(&E) -> bool,

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> Filter<O, E> for I
where I: Iterator<Item = Result<O, E>> + Sized,