Struct Drain

pub struct Drain<'a, T> { /* private fields */ }

A draining iterator over the items of an IndexSet.

This struct is created by the IndexSet::drain method. See its documentation for more.

Implementations

impl<'a, T> Drain<'a, T>

fn as_slice(&self) -> &Slice<T>

Returns a slice of the remaining entries in the iterator.

Trait Implementations

impl<T> DoubleEndedIterator for Drain<'_, T>

fn next_back(&mut self) -> Option<Self::Item>
fn nth_back(&mut self, n: usize) -> Option<Self::Item>

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

fn len(&self) -> usize

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

impl<T> Iterator for Drain<'_, T>

type Item = T;
fn next(&mut self) -> Option<Self::Item>
fn size_hint(&self) -> (usize, Option<usize>)
fn count(self) -> usize
fn nth(&mut self, n: usize) -> Option<Self::Item>
fn last(self) -> Option<Self::Item>
fn collect<C>(self) -> C
where
    C: FromIterator<Self::Item>,

impl<T: Debug> Debug for Drain<'_, T>

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

Auto Trait Implementations

impl<'a, T> Freeze for Drain<'a, T> where Drain<'a, Bucket<T, ()>>: Freeze,

impl<'a, T> RefUnwindSafe for Drain<'a, T> where Drain<'a, Bucket<T, ()>>: RefUnwindSafe,

impl<'a, T> Send for Drain<'a, T> where Drain<'a, Bucket<T, ()>>: Send,

impl<'a, T> Sync for Drain<'a, T> where Drain<'a, Bucket<T, ()>>: Sync,

impl<'a, T> Unpin for Drain<'a, T> where Drain<'a, Bucket<T, ()>>: Unpin,

impl<'a, T> UnsafeUnpin for Drain<'a, T> where Drain<'a, Bucket<T, ()>>: UnsafeUnpin,

impl<'a, T> UnwindSafe for Drain<'a, T> where Drain<'a, Bucket<T, ()>>: UnwindSafe,

Blanket Implementations

impl<I> IntoIterator for Drain<'a, T> where I: Iterator,

type Item = <I as Iterator>::Item;
type IntoIter = I;
fn into_iter(self) -> I

impl<T> Any for Drain<'a, T> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Drain<'a, T> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Drain<'a, T> where T: ?Sized,

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

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

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for Drain<'a, T> where U: From<T>,

fn into(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<U> for Drain<'a, T> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Drain<'a, T> where U: TryFrom<T>,

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