pub struct ConsIter<'buf, B: MutRB, const W: bool> { /* private fields */ }Expand description
Implementations§
Source§impl<'buf, B: MutRB<Item = T>, T, const W: bool> ConsIter<'buf, B, W>
impl<'buf, B: MutRB<Item = T>, T, const W: bool> ConsIter<'buf, B, W>
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 peek_ref<'a>(&mut self) -> Option<&'a T>
pub fn peek_ref<'a>(&mut self) -> Option<&'a T>
Returns a reference to an element.
Being this a reference, Self::advance() has to be called when done with the data
in order to move the iterator.
Sourcepub fn peek_slice<'a>(&mut self, count: usize) -> Option<NonMutableSlice<'a, T>>
pub fn peek_slice<'a>(&mut self, count: usize) -> Option<NonMutableSlice<'a, T>>
Returns a tuple of slice references, the sum of which with len equal to count.
Being these references, Self::advance() has to be called when done with the data
in order to move the iterator.
Sourcepub fn peek_available<'a>(&mut self) -> Option<NonMutableSlice<'a, T>>
pub fn peek_available<'a>(&mut self) -> Option<NonMutableSlice<'a, T>>
Returns a tuple of slice references, the sum of which with len equal to available data.
Being these references, Self::advance() has to be called when done with the data
in order to move the iterator.
Sourcepub fn pop(&mut self) -> Option<T>
pub fn pop(&mut self) -> Option<T>
Tries to pop an element, duplicating it.
§Safety
This method acts like ptr::read: it duplicates the item by making a bitwise copy, ignoring whether it is Copy/Clone or not.
So it is your responsibility to ensure that the data may indeed be duplicated.
Sourcepub fn copy_item(&mut self, dst: &mut T) -> Option<()>where
T: Copy,
pub fn copy_item(&mut self, dst: &mut T) -> Option<()>where
T: Copy,
- Returns
Some(()), copying next item intodst, if available. - Returns
Nonedoing nothing, otherwise.
This method uses copy and should be preferred over clone version, if possible.
Unlike peek* methods, this one automatically advances the iterator.
Sourcepub fn clone_item(&mut self, dst: &mut T) -> Option<()>where
T: Clone,
pub fn clone_item(&mut self, dst: &mut T) -> Option<()>where
T: Clone,
Same as Self::copy_item, but uses clone, instead.
Unlike peek* methods, this one automatically advances the iterator.
Sourcepub fn copy_slice(&mut self, dst: &mut [T]) -> Option<()>where
T: Copy,
pub fn copy_slice(&mut self, dst: &mut [T]) -> Option<()>where
T: Copy,
- Returns
Some(()), fillingdstslice with the nextdst.len()values, if available. - Returns
Nonedoing nothing, otherwise.
This method fills the slice using copy and should be preferred over clone version, if possible.
Unlike peek* methods, this one automatically advances the iterator.
Sourcepub fn clone_slice(&mut self, dst: &mut [T]) -> Option<()>where
T: Clone,
pub fn clone_slice(&mut self, dst: &mut [T]) -> Option<()>where
T: Clone,
Same as Self::copy_slice, but uses clone, instead.
Unlike peek* methods, this one automatically advances the iterator.
Trait Implementations§
Source§impl<B: MutRB<Item = T>, T, const W: bool> MRBIterator for ConsIter<'_, B, W>
impl<B: MutRB<Item = T>, T, const W: bool> MRBIterator for ConsIter<'_, B, W>
type Item = T
Source§fn detach(self) -> Detached<Self>where
Self: Sized,
fn detach(self) -> Detached<Self>where
Self: Sized,
Detached.Source§fn wait_for(&mut self, count: usize)
fn wait_for(&mut self, count: usize)
count available items.Source§fn alive_iters(&self) -> u8
fn alive_iters(&self) -> u8
Source§fn prod_index(&self) -> usize
fn prod_index(&self) -> usize
Source§fn work_index(&self) -> usize
fn work_index(&self) -> usize
Source§fn cons_index(&self) -> usize
fn cons_index(&self) -> usize
Source§fn get_workable<'a>(&mut self) -> Option<&'a mut Self::Item>
fn get_workable<'a>(&mut self) -> Option<&'a mut Self::Item>
Source§fn get_workable_slice_exact<'a>(
&mut self,
count: usize,
) -> Option<MutableSlice<'a, <Self as MRBIterator>::Item>>
fn get_workable_slice_exact<'a>( &mut self, count: usize, ) -> Option<MutableSlice<'a, <Self as MRBIterator>::Item>>
count. Read moreSource§fn get_workable_slice_avail<'a>(
&mut self,
) -> Option<MutableSlice<'a, <Self as MRBIterator>::Item>>
fn get_workable_slice_avail<'a>( &mut self, ) -> Option<MutableSlice<'a, <Self as MRBIterator>::Item>>
Self::available(). Read moreSource§fn get_workable_slice_multiple_of<'a>(
&mut self,
rhs: usize,
) -> Option<MutableSlice<'a, <Self as MRBIterator>::Item>>
fn get_workable_slice_multiple_of<'a>( &mut self, rhs: usize, ) -> Option<MutableSlice<'a, <Self as MRBIterator>::Item>>
rhs. Read more