Struct IterMut
pub struct IterMut<'a, T: 'a> { pub(in ::collections::vec_deque::iter_mut) i1: IterMut<'a, T>, pub(in ::collections::vec_deque::iter_mut) i2: IterMut<'a, T> }
A mutable iterator over the elements of a VecDeque.
This struct is created by the iter_mut method on super::VecDeque. See its
documentation for more.
Fields
i1: IterMut<'a, T>i2: IterMut<'a, T>
Implementations
impl<'a, T> IterMut<'a, T>
fn new(i1: IterMut<'a, T>, i2: IterMut<'a, T>) -> Selffn into_slices(self) -> (&'a mut [T], &'a mut [T])Views the underlying data as a pair of subslices of the original data.
The slices contain, in order, the contents of the deque not yet yielded by the iterator.
To avoid creating
&mutreferences that alias, this is forced to consume the iterator.Examples
use VecDeque; let mut deque = new; deque.push_back; deque.push_back; deque.push_back; deque.push_front; deque.push_front; deque.push_front; let mut iter = deque.iter_mut; iter.next; iter.next_back; let slices = iter.into_slices; slices.0 = 42; slices.1 = 24; assert_eq!;fn as_slices(&self) -> (&[T], &[T])Views the underlying data as a pair of subslices of the original data.
The slices contain, in order, the contents of the deque not yet yielded by the iterator.
To avoid creating
&mut [T]references that alias, the returned slices borrow their lifetimes from the iterator the method is applied on.Examples
use VecDeque; let mut deque = new; deque.push_back; deque.push_back; deque.push_back; deque.push_front; deque.push_front; deque.push_front; let mut iter = deque.iter_mut; iter.next; iter.next_back; assert_eq!;fn as_mut_slices(&mut self) -> (&mut [T], &mut [T])Views the underlying data as a pair of subslices of the original data.
The slices contain, in order, the contents of the deque not yet yielded by the iterator.
To avoid creating
&mut [T]references that alias, the returned slices borrow their lifetimes from the iterator the method is applied on.Examples
use VecDeque; let mut deque = new; deque.push_back; deque.push_back; deque.push_back; deque.push_front; deque.push_front; deque.push_front; let mut iter = deque.iter_mut; iter.next; iter.next_back; iter.as_mut_slices.0 = 42; iter.as_mut_slices.1 = 24; assert_eq!;
Trait Implementations
impl<'a, T> DoubleEndedIterator for IterMut<'a, T>
fn next_back(&mut self) -> Option<&'a mut T>fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>fn rfold<Acc, F>(self, accum: Acc, f: F) -> Acc where F: FnMut(Acc, Self::Item) -> Acc,fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R where F: FnMut(B, Self::Item) -> R, R: Try<Output = B>,
impl<'a, T> Iterator for IterMut<'a, T>
type Item = &'a mut T;fn next(&mut self) -> Option<&'a mut T>fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>fn size_hint(&self) -> (usize, Option<usize>)fn fold<Acc, F>(self, accum: Acc, f: F) -> Acc where F: FnMut(Acc, Self::Item) -> Acc,fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R where F: FnMut(B, Self::Item) -> R, R: Try<Output = B>,fn last(self) -> Option<&'a mut T>unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> Self::Item
impl<T> Default for IterMut<'_, T>
fn default() -> SelfCreates an empty
vec_deque::IterMut.# use vec_deque; let iter: IterMut = Defaultdefault; assert_eq!;
impl<T> ExactSizeIterator for IterMut<'_, T>
fn len(&self) -> usizefn is_empty(&self) -> bool
impl<T> FusedIterator for IterMut<'_, T>
impl<T> TrustedLen for IterMut<'_, T>
impl<T> TrustedRandomAccess for IterMut<'_, T>
impl<T> TrustedRandomAccessNoCoerce for IterMut<'_, T>
const MAY_HAVE_SIDE_EFFECT: bool = false;
impl<T: Debug> Debug for IterMut<'_, T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<'a, T> !UnwindSafe for IterMut<'a, T>
impl<'a, T> Freeze for IterMut<'a, T>
where
IterMut<'a, T>: Freeze + Freeze,
impl<'a, T> RefUnwindSafe for IterMut<'a, T>
where
IterMut<'a, T>: RefUnwindSafe + RefUnwindSafe,
impl<'a, T> Send for IterMut<'a, T>
where
IterMut<'a, T>: Send + Send,
impl<'a, T> Sync for IterMut<'a, T>
where
IterMut<'a, T>: Sync + Sync,
impl<'a, T> Unpin for IterMut<'a, T>
where
IterMut<'a, T>: Unpin + Unpin,
impl<'a, T> UnsafeUnpin for IterMut<'a, T>
where
IterMut<'a, T>: UnsafeUnpin + UnsafeUnpin,
Blanket Implementations
impl<I> IntoIterator for IterMut<'a, T>
where
I: Iterator,
type Item = <I as Iterator>::Item;type IntoIter = I;fn into_iter(self) -> I
impl<T> Any for IterMut<'a, T>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for IterMut<'a, T>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for IterMut<'a, T>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for IterMut<'a, T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for IterMut<'a, T>
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for IterMut<'a, T>
impl<T, U> Into<U> for IterMut<'a, T>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for IterMut<'a, T>
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for IterMut<'a, T>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>