pub struct MaybeParallelIterator<IT: Iterator>(/* private fields */);
Expand description
An iterator that may be sequential or parallel depending on feature flags.
Implementations§
Source§impl<IT: Iterator> MaybeParallelIterator<IT>
impl<IT: Iterator> MaybeParallelIterator<IT>
pub fn collect<B: FromIterator<IT::Item>>(self) -> Bwhere
Self: Sized,
Sourcepub fn with_min_sequential(self, _: usize) -> Self
pub fn with_min_sequential(self, _: usize) -> Self
Process at least this many items sequentially (no-op unless rayon
feature enabled).
§Foot-gun
Without rayon
feature, this can be called in places IndexedParallelIterator
would not
apply. These uses won’t compile under rayon
.
Sourcepub fn enumerate(self) -> MaybeParallelIterator<Enumerate<IT>>
pub fn enumerate(self) -> MaybeParallelIterator<Enumerate<IT>>
Map to a tuple containing the index of each item along with that item.
§Foot-gun
Without rayon
feature, this can be called in places IndexedParallelIterator
would not
apply. These uses won’t compile under rayon
.
Sourcepub fn map<O, M: Fn(IT::Item) -> O>(
self,
map: M,
) -> MaybeParallelIterator<Map<IT, M>>
pub fn map<O, M: Fn(IT::Item) -> O>( self, map: M, ) -> MaybeParallelIterator<Map<IT, M>>
Like iterator mapping.
Sourcepub fn filter_map<O, M: Fn(IT::Item) -> Option<O>>(
self,
map: M,
) -> MaybeParallelIterator<FilterMap<IT, M>>
pub fn filter_map<O, M: Fn(IT::Item) -> Option<O>>( self, map: M, ) -> MaybeParallelIterator<FilterMap<IT, M>>
Like iterator filter mapping.
Sourcepub fn flat_map<O: IntoIterator, M: Fn(IT::Item) -> O>(
self,
map: M,
) -> MaybeParallelIterator<FlatMap<IT, O, M>>
pub fn flat_map<O: IntoIterator, M: Fn(IT::Item) -> O>( self, map: M, ) -> MaybeParallelIterator<FlatMap<IT, O, M>>
Like iterator flat-mapping.
Sourcepub fn find_any<F: Fn(&IT::Item) -> bool>(self, f: F) -> Option<IT::Item>
pub fn find_any<F: Fn(&IT::Item) -> bool>(self, f: F) -> Option<IT::Item>
Like iterator find (but won’t necessarily return the first match).
Sourcepub fn into_inner(self) -> IT
pub fn into_inner(self) -> IT
Get the inner iterator.
Trait Implementations§
Source§impl<IT: Iterator> IntoIterator for MaybeParallelIterator<IT>
impl<IT: Iterator> IntoIterator for MaybeParallelIterator<IT>
Auto Trait Implementations§
impl<IT> Freeze for MaybeParallelIterator<IT>where
IT: Freeze,
impl<IT> RefUnwindSafe for MaybeParallelIterator<IT>where
IT: RefUnwindSafe,
impl<IT> Send for MaybeParallelIterator<IT>where
IT: Send,
impl<IT> Sync for MaybeParallelIterator<IT>where
IT: Sync,
impl<IT> Unpin for MaybeParallelIterator<IT>where
IT: Unpin,
impl<IT> UnwindSafe for MaybeParallelIterator<IT>where
IT: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more