Struct rayon::iter::plumbing::LengthSplitter
source · struct LengthSplitter {
inner: Splitter,
min: usize,
}
Expand description
The length splitter is built on thief-splitting, but additionally takes into account the remaining length of the iterator.
Fields§
§inner: Splitter
§min: usize
The smallest we’re willing to divide into. Usually this is just 1,
but you can choose a larger working size with with_min_len()
.
Implementations§
source§impl LengthSplitter
impl LengthSplitter
sourcefn new(min: usize, max: usize, len: usize) -> LengthSplitter
fn new(min: usize, max: usize, len: usize) -> LengthSplitter
Creates a new splitter based on lengths.
The min
is a hard lower bound. We’ll never split below that, but
of course an iterator might start out smaller already.
The max
is an upper bound on the working size, used to determine
the minimum number of times we need to split to get under that limit.
The adaptive algorithm may very well split even further, but never
smaller than the min
.
fn try_split(&mut self, len: usize, stolen: bool) -> bool
Trait Implementations§
source§impl Clone for LengthSplitter
impl Clone for LengthSplitter
source§fn clone(&self) -> LengthSplitter
fn clone(&self) -> LengthSplitter
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreimpl Copy for LengthSplitter
Auto Trait Implementations§
impl Freeze for LengthSplitter
impl RefUnwindSafe for LengthSplitter
impl Send for LengthSplitter
impl Sync for LengthSplitter
impl Unpin for LengthSplitter
impl UnwindSafe for LengthSplitter
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more