Struct Drain

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

A draining iterator over the items of a HashTable.

This struct is created by the drain method on HashTable. See its documentation for more.

Implementations

impl<'a, T, A: Allocator> Drain<'a, T, A>

fn iter(&self) -> Iter<'_, T>

Returns a iterator of references over the remaining items.

Trait Implementations

impl<T, A: Allocator> ExactSizeIterator for Drain<'_, T, A>

fn len(&self) -> usize

impl<T, A: Allocator> FusedIterator for Drain<'_, T, A>

impl<T, A: Allocator> Iterator for Drain<'_, T, A>

type Item = T;
fn next(&mut self) -> Option<T>
fn size_hint(&self) -> (usize, Option<usize>)
fn fold<B, F>(self, init: B, f: F) -> B
where
    Self: Sized,
    F: FnMut(B, Self::Item) -> B,

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

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

Auto Trait Implementations

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

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

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

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

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

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

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

Blanket Implementations

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

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

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for Drain<'a, T, A> 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, A> where U: Into<T>,

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

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

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