[][src]Trait nonogrid::utils::iter::FindOk

pub trait FindOk: Iterator {
    fn first_ok_with_error<B, E, F>(
        &mut self,
        on_empty_error: E,
        f: F
    ) -> Result<B, E>
    where
        Self: Sized,
        F: FnMut(Self::Item) -> Result<B, E>
, { ... }
fn first_ok<B, E, F>(&mut self, f: F) -> Result<B, E>
    where
        Self: Sized,
        E: Default,
        F: FnMut(Self::Item) -> Result<B, E>
, { ... } }

Provided methods

fn first_ok_with_error<B, E, F>(
    &mut self,
    on_empty_error: E,
    f: F
) -> Result<B, E> where
    Self: Sized,
    F: FnMut(Self::Item) -> Result<B, E>, 

Generalization of find_map for Result type. If the iterator is exhausted, return on_empty_error.

fn first_ok<B, E, F>(&mut self, f: F) -> Result<B, E> where
    Self: Sized,
    E: Default,
    F: FnMut(Self::Item) -> Result<B, E>, 

Generalization of find_map for Result type. If the iterator is exhausted, return default error for provided E type.

Loading content...

Implementors

impl<I: Iterator> FindOk for I[src]

fn first_ok_with_error<B, E, F>(
    &mut self,
    on_empty_error: E,
    f: F
) -> Result<B, E> where
    Self: Sized,
    F: FnMut(Self::Item) -> Result<B, E>, 
[src]

fn first_ok<B, E, F>(&mut self, f: F) -> Result<B, E> where
    Self: Sized,
    E: Default,
    F: FnMut(Self::Item) -> Result<B, E>, 
[src]

Loading content...