1.0.0[][src]Struct alloc::vec::IntoIter

pub struct IntoIter<T, A: AllocRef = Global> { /* fields omitted */ }

An iterator that moves out of a vector.

This struct is created by the into_iter method on Vec (provided by the IntoIterator trait).

Example

let v = vec![0, 1, 2];
let iter: std::vec::IntoIter<_> = v.into_iter();
Run

Implementations

impl<T, A: AllocRef> IntoIter<T, A>[src]

pub fn as_slice(&self) -> &[T]1.15.0[src]

Returns the remaining items of this iterator as a slice.

Examples

let vec = vec!['a', 'b', 'c'];
let mut into_iter = vec.into_iter();
assert_eq!(into_iter.as_slice(), &['a', 'b', 'c']);
let _ = into_iter.next().unwrap();
assert_eq!(into_iter.as_slice(), &['b', 'c']);
Run

pub fn as_mut_slice(&mut self) -> &mut [T]1.15.0[src]

Returns the remaining items of this iterator as a mutable slice.

Examples

let vec = vec!['a', 'b', 'c'];
let mut into_iter = vec.into_iter();
assert_eq!(into_iter.as_slice(), &['a', 'b', 'c']);
into_iter.as_mut_slice()[2] = 'z';
assert_eq!(into_iter.next().unwrap(), 'a');
assert_eq!(into_iter.next().unwrap(), 'b');
assert_eq!(into_iter.next().unwrap(), 'z');
Run

pub fn alloc_ref(&self) -> &A[src]

🔬 This is a nightly-only experimental API. (allocator_api #32838)

Returns a reference to the underlying allocator.

Trait Implementations

impl<T, A: AllocRef> AsRef<[T]> for IntoIter<T, A>1.46.0[src]

impl<T: Clone, A: AllocRef + Clone> Clone for IntoIter<T, A>1.8.0[src]

impl<T: Debug, A: AllocRef> Debug for IntoIter<T, A>1.13.0[src]

impl<T, A: AllocRef> DoubleEndedIterator for IntoIter<T, A>[src]

impl<T, A: AllocRef> Drop for IntoIter<T, A>[src]

impl<T, A: AllocRef> ExactSizeIterator for IntoIter<T, A>[src]

impl<T, A: AllocRef> FusedIterator for IntoIter<T, A>1.26.0[src]

impl<T, A: AllocRef> InPlaceIterable for IntoIter<T, A>[src]

impl<T, A: AllocRef> Iterator for IntoIter<T, A>[src]

type Item = T

The type of the elements being iterated over.

impl<T: Send, A: AllocRef + Send> Send for IntoIter<T, A>[src]

impl<T, A: AllocRef> SourceIter for IntoIter<T, A>[src]

type Source = Self

🔬 This is a nightly-only experimental API. (inplace_iteration)

A source stage in an iterator pipeline.

impl<T: Sync, A: AllocRef> Sync for IntoIter<T, A>[src]

impl<T, A: AllocRef> TrustedLen for IntoIter<T, A>[src]

Auto Trait Implementations

impl<T, A> Unpin for IntoIter<T, A> where
    A: Unpin,
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.