pub struct WorkIter<B: MutRB<T>, T, A> { /* private fields */ }Expand description
Iterator used to mutate elements in-place.
This iterator returns mutable references to data stored within the buffer.
Thus, as stated in the docs below, Self::advance has to be called when done with the mutation
in order to move the iterator.
Self::advance updates a global iterator, which is read by the consumer to decide if it can move on.
To avoid this, a DetachedWorkIter can be obtained by calling Self::detach.
Implementations§
source§impl<B: MutRB<T>, T, A> WorkIter<B, T, A>
impl<B: MutRB<T>, T, A> WorkIter<B, T, A>
sourcepub fn is_prod_alive(&self) -> bool
pub fn is_prod_alive(&self) -> bool
Returns true if the producer iterator is still alive, false if it has been dropped.
sourcepub fn is_cons_alive(&self) -> bool
pub fn is_cons_alive(&self) -> bool
Returns true if the consumer iterator is still alive, false if it has been dropped.
sourcepub fn detach(self) -> DetachedWorkIter<B, T, A>
pub fn detach(self) -> DetachedWorkIter<B, T, A>
Detaches the iterator yielding a DetachedWorkIter.
sourcepub fn reset_index(&mut self)
pub fn reset_index(&mut self)
Resets the index of the iterator. I.e., moves the iterator to the location occupied by its successor.
sourcepub fn get_workable(&mut self) -> Option<(&mut T, &mut A)>
pub fn get_workable(&mut self) -> Option<(&mut T, &mut A)>
Returns a tuple containing mutable references to actual value and accumulator.
Being these references, Self::advance() has to be called when done with the mutation
in order to move the iterator.
sourcepub fn get_workable_slice_exact(
&mut self,
count: usize
) -> Option<WorkableSlice<'_, T, A>>
pub fn get_workable_slice_exact( &mut self, count: usize ) -> Option<WorkableSlice<'_, T, A>>
Returns a tuple of mutable slice references, the sum of which with len equal to count, along
with accumulator.
Being these references, Self::advance() has to be called when done with the mutation
in order to move the iterator.
sourcepub fn get_workable_slice_avail(&mut self) -> Option<WorkableSlice<'_, T, A>>
pub fn get_workable_slice_avail(&mut self) -> Option<WorkableSlice<'_, T, A>>
Returns a tuple of mutable slice references, the sum of which with len equal to Self::available(), along
with accumulator.
Being these references, Self::advance() has to be called when done with the mutation
in order to move the iterator.
sourcepub fn get_workable_slice_multiple_of(
&mut self,
rhs: usize
) -> Option<WorkableSlice<'_, T, A>>
pub fn get_workable_slice_multiple_of( &mut self, rhs: usize ) -> Option<WorkableSlice<'_, T, A>>
Returns a tuple of mutable slice references, the sum of which with len equal to the
maximum multiple of modulo, along with accumulator.
Being these references, Self::advance() has to be called when done with the mutation
in order to move the iterator.