pub struct ParRef<'a, T, P> { /* private fields */ }Expand description
A read-only parallel view of a slice bound to execution policy P.
Construct via ParallelSlice::par. Zero-sized beyond the borrowed slice.
Implementations§
Source§impl<'a, T, P> ParRef<'a, T, P>where
P: ExecutionPolicy,
impl<'a, T, P> ParRef<'a, T, P>where
P: ExecutionPolicy,
Sourcepub fn for_each<F>(self, f: F)
pub fn for_each<F>(self, f: F)
Apply f to every element. See for_each_with.
Sourcepub fn enumerate<F>(self, f: F)
pub fn enumerate<F>(self, f: F)
Apply f(index, &element) to every element. See enumerate_with.
Sourcepub fn map_collect<R, F>(self, f: F) -> Vec<R>
pub fn map_collect<R, F>(self, f: F) -> Vec<R>
Map then collect into a Vec<R> in order. See map_collect_with.
Sourcepub fn map_collect_index<R, F>(self, f: F) -> Vec<R>
pub fn map_collect_index<R, F>(self, f: F) -> Vec<R>
Map each (index, &element) pair, then collect into a Vec<R> in order.
This is the indexed counterpart to Self::map_collect. It exposes the
logical slice index without requiring callers to derive it from pointers.
Auto Trait Implementations§
impl<'a, T, P> Freeze for ParRef<'a, T, P>
impl<'a, T, P> RefUnwindSafe for ParRef<'a, T, P>
impl<'a, T, P> Send for ParRef<'a, T, P>
impl<'a, T, P> Sync for ParRef<'a, T, P>
impl<'a, T, P> Unpin for ParRef<'a, T, P>
impl<'a, T, P> UnsafeUnpin for ParRef<'a, T, P>
impl<'a, T, P> UnwindSafe for ParRef<'a, T, P>
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