Skip to main content

TryFindIterator

Trait TryFindIterator 

Source
pub trait TryFindIterator<T, E>: Sized + Iterator<Item = Result<T, E>> {
    // Provided method
    fn do_try_find<P>(self, predicate: P) -> Result<Option<T>, E>
       where P: FnMut(&T) -> Result<bool, E> { ... }
}
Expand description

An extension trait for Iterator implementing several utility methods.

Provided Methods§

Source

fn do_try_find<P>(self, predicate: P) -> Result<Option<T>, E>
where P: FnMut(&T) -> Result<bool, E>,

Find the first element that satisfies the supplied predicate.

Method name is do_try_find to avoid collissions with Iterator::try_find once it gets stabilized.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, I, E> TryFindIterator<T, E> for I
where I: Iterator<Item = Result<T, E>>,