Trait heron::rapier_plugin::rapier::rayon::prelude::ParallelSlice[][src]

pub trait ParallelSlice<T> where
    T: Sync
{ pub fn as_parallel_slice(&self) -> &[T]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
; pub fn par_split<P>(&self, separator: P) -> Split<'_, T, P>
    where
        P: Fn(&T) -> bool + Sync + Send
, { ... }
pub fn par_windows(&self, window_size: usize) -> Windows<'_, T> { ... }
pub fn par_chunks(&self, chunk_size: usize) -> Chunks<'_, T> { ... }
pub fn par_chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T> { ... } }

Parallel extensions for slices.

Required methods

pub fn as_parallel_slice(&self) -> &[T]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns a plain slice, which is used to implement the rest of the parallel methods.

Loading content...

Provided methods

pub fn par_split<P>(&self, separator: P) -> Split<'_, T, P> where
    P: Fn(&T) -> bool + Sync + Send
[src]

Returns a parallel iterator over subslices separated by elements that match the separator.

Examples

use rayon::prelude::*;
let smallest = [1, 2, 3, 0, 2, 4, 8, 0, 3, 6, 9]
    .par_split(|i| *i == 0)
    .map(|numbers| numbers.iter().min().unwrap())
    .min();
assert_eq!(Some(&1), smallest);

pub fn par_windows(&self, window_size: usize) -> Windows<'_, T>[src]

Returns a parallel iterator over all contiguous windows of length window_size. The windows overlap.

Examples

use rayon::prelude::*;
let windows: Vec<_> = [1, 2, 3].par_windows(2).collect();
assert_eq!(vec![[1, 2], [2, 3]], windows);

pub fn par_chunks(&self, chunk_size: usize) -> Chunks<'_, T>[src]

Returns a parallel iterator over at most chunk_size elements of self at a time. The chunks do not overlap.

If the number of elements in the iterator is not divisible by chunk_size, the last chunk may be shorter than chunk_size. All other chunks will have that exact length.

Examples

use rayon::prelude::*;
let chunks: Vec<_> = [1, 2, 3, 4, 5].par_chunks(2).collect();
assert_eq!(chunks, vec![&[1, 2][..], &[3, 4], &[5]]);

pub fn par_chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>[src]

Returns a parallel iterator over chunk_size elements of self at a time. The chunks do not overlap.

If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved from the remainder function of the iterator.

Examples

use rayon::prelude::*;
let chunks: Vec<_> = [1, 2, 3, 4, 5].par_chunks_exact(2).collect();
assert_eq!(chunks, vec![&[1, 2][..], &[3, 4]]);
Loading content...

Implementations on Foreign Types

impl<T> ParallelSlice<T> for [T] where
    T: Sync
[src]

Loading content...

Implementors

Loading content...