Struct sync_splitter::SyncSplitter
[−]
[src]
pub struct SyncSplitter<'a, T: 'a + Sync> { /* fields omitted */ }
A SyncSplitter
allows multiple threads to split a mutable slice at the same time.
See the module docs for more information.
Methods
impl<'a, T: 'a + Sync> SyncSplitter<'a, T>
[src]
fn new(slice: &'a mut [T]) -> Self
[src]
fn pop(&self) -> Option<(&mut T, usize)>
[src]
Pops one mutable reference off the slice and returns it.
Also returns the element's index in the original slice.
Returns None
if the underlying slice was exhausted. After that, all future pop
calls
will return None
.
fn pop_two(&self) -> Option<((&mut T, &mut T), usize)>
[src]
Pops two mutable references off the slice and returns them.
Also return the returned slice's offset into the original slice.
Returns None
if the underlying slice doesn't have enough elements left.
fn pop_n(&self, len: usize) -> Option<(&mut [T], usize)>
[src]
Pops a mutable slice of a given length and returns it.
Also return the returned slice's offset into the original slice.
Returns None
if not enough elements were left in the underlying slice.
fn done(self) -> usize
[src]
Consumes the splitter and returns the total number of popped elements.