Skip to main content

ParIterExt

Trait ParIterExt 

Source
pub trait ParIterExt: Iterator {
    // Required methods
    fn find_any<P>(self, predicate: P) -> Option<Self::Item>
       where P: Fn(&Self::Item) -> bool + Sync + Send;
    fn find_map_any<P, R>(self, predicate: P) -> Option<R>
       where P: Fn(Self::Item) -> Option<R> + Sync + Send;
    fn flat_map_iter<U, F>(self, map_op: F) -> FlatMap<Self, U, F> 
       where Self: Sized,
             U: IntoIterator,
             F: Fn(Self::Item) -> U;
    fn for_each_init<OP, INIT, T>(self, init: INIT, op: OP)
       where Self: Sized,
             OP: Fn(&mut T, Self::Item) + Sync + Send,
             INIT: Fn() -> T + Sync + Send;

    // Provided methods
    fn with_min_len(self, min_len: usize) -> Self
       where Self: Sized { ... }
    fn with_max_len(self, max_len: usize) -> Self
       where Self: Sized { ... }
}

Required Methods§

Source

fn find_any<P>(self, predicate: P) -> Option<Self::Item>
where P: Fn(&Self::Item) -> bool + Sync + Send,

Serially, this returns the first matching item, unlike rayon’s find_any, which may return any matching item found by any thread.

Source

fn find_map_any<P, R>(self, predicate: P) -> Option<R>
where P: Fn(Self::Item) -> Option<R> + Sync + Send,

Source

fn flat_map_iter<U, F>(self, map_op: F) -> FlatMap<Self, U, F>
where Self: Sized, U: IntoIterator, F: Fn(Self::Item) -> U,

Source

fn for_each_init<OP, INIT, T>(self, init: INIT, op: OP)
where Self: Sized, OP: Fn(&mut T, Self::Item) + Sync + Send, INIT: Fn() -> T + Sync + Send,

Serially, init is called once and the single state is reused across every item, unlike rayon’s for_each_init, which calls init once per split.

Provided Methods§

Source

fn with_min_len(self, min_len: usize) -> Self
where Self: Sized,

No-op: there is only one split in a serial build, so a minimum split length has nothing to constrain.

Source

fn with_max_len(self, max_len: usize) -> Self
where Self: Sized,

No-op: there is only one split in a serial build, so a maximum split length has nothing to constrain.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§