Struct Iter

struct Iter<'a, T: 'a> { ... }

An iterator over the elements of a VecDeque.

This struct is created by the iter method on super::VecDeque. See its documentation for more.

Implementations

impl<'a, T> Iter<'a, T>

fn as_slices(self: &Self) -> (&'a [T], &'a [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.

This has the same lifetime as the original VecDeque, and so the iterator can continue to be used while this exists.

Examples

#![feature(vec_deque_iter_as_slices)]

use std::collections::VecDeque;

let mut deque = VecDeque::new();
deque.push_back(0);
deque.push_back(1);
deque.push_back(2);
deque.push_front(10);
deque.push_front(9);
deque.push_front(8);

let mut iter = deque.iter();
iter.next();
iter.next_back();

assert_eq!(iter.as_slices(), (&[9, 10][..], &[0, 1][..]));

impl<'a, T> DoubleEndedIterator for Iter<'a, T>

fn next_back(self: &mut Self) -> Option<&'a T>
fn advance_back_by(self: &mut Self, n: usize) -> Result<(), NonZero<usize>>
fn rfold<Acc, F>(self: Self, accum: Acc, f: F) -> Acc
where
    F: FnMut(Acc, <Self as >::Item) -> Acc
fn try_rfold<B, F, R>(self: &mut Self, init: B, f: F) -> R
where
    F: FnMut(B, <Self as >::Item) -> R,
    R: Try<Output = B>

impl<'a, T> Freeze for Iter<'a, T>

impl<'a, T> Iterator for Iter<'a, T>

fn next(self: &mut Self) -> Option<&'a T>
fn advance_by(self: &mut Self, n: usize) -> Result<(), NonZero<usize>>
fn size_hint(self: &Self) -> (usize, Option<usize>)
fn fold<Acc, F>(self: Self, accum: Acc, f: F) -> Acc
where
    F: FnMut(Acc, <Self as >::Item) -> Acc
fn try_fold<B, F, R>(self: &mut Self, init: B, f: F) -> R
where
    F: FnMut(B, <Self as >::Item) -> R,
    R: Try<Output = B>
fn last(self: Self) -> Option<&'a T>

impl<'a, T> RefUnwindSafe for Iter<'a, T>

impl<'a, T> Send for Iter<'a, T>

impl<'a, T> Sync for Iter<'a, T>

impl<'a, T> Unpin for Iter<'a, T>

impl<'a, T> UnsafeUnpin for Iter<'a, T>

impl<'a, T> UnwindSafe for Iter<'a, T>

impl<I> IntoIterator for Iter<'a, T>

fn into_iter(self: Self) -> I

impl<T> Any for Iter<'a, T>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Iter<'a, T>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Iter<'a, T>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> Clone for Iter<'_, T>

fn clone(self: &Self) -> Self

impl<T> CloneToUninit for Iter<'a, T>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> Default for Iter<'_, T>

fn default() -> Self

Creates an empty vec_deque::Iter.

# use std::collections::vec_deque;
let iter: vec_deque::Iter<'_, u8> = Default::default();
assert_eq!(iter.len(), 0);

impl<T> ExactSizeIterator for Iter<'_, T>

fn len(self: &Self) -> usize
fn is_empty(self: &Self) -> bool

impl<T> From for Iter<'a, T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> FusedIterator for Iter<'_, T>

impl<T> ToOwned for Iter<'a, T>

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T> TrustedLen for Iter<'_, T>

impl<T, U> Into for Iter<'a, T>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Iter<'a, T>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Iter<'a, T>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>

impl<T: fmt::Debug> Debug for Iter<'_, T>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result