[][src]Struct alloc_wg::vec::Drain

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

A draining iterator for Vec<T>.

This struct is created by the drain method on Vec.

Implementations

impl<T, A: AllocRef, '_> Drain<'_, T, A>[src]

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

Returns the remaining items of this iterator as a slice.

Examples

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

Trait Implementations

impl<T: Debug, A: AllocRef, '_> Debug for Drain<'_, T, A>[src]

impl<T, A: AllocRef, '_> DoubleEndedIterator for Drain<'_, T, A>[src]

impl<T, A: AllocRef, '_> Drop for Drain<'_, T, A>[src]

impl<T, A: AllocRef, '_> ExactSizeIterator for Drain<'_, T, A>[src]

impl<T, A: AllocRef, '_> FusedIterator for Drain<'_, T, A>[src]

impl<T, A: AllocRef, '_> Iterator for Drain<'_, T, A>[src]

type Item = T

The type of the elements being iterated over.

impl<T: Send, A: AllocRef, '_> Send for Drain<'_, T, A>[src]

impl<T: Sync, A: AllocRef, '_> Sync for Drain<'_, T, A>[src]

Auto Trait Implementations

impl<'a, T, A> RefUnwindSafe for Drain<'a, T, A> where
    A: RefUnwindSafe,
    T: RefUnwindSafe

impl<'a, T, A> Unpin for Drain<'a, T, A>

impl<'a, T, A> UnwindSafe for Drain<'a, T, A> where
    A: RefUnwindSafe,
    T: RefUnwindSafe

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> IteratorExt for T where
    T: Iterator
[src]

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.