pub struct IntoIter<I: ?Sized + LendingIterator>(pub I);
Expand description

The impl Iterator (not a LendingIterator!) returned by .into_iter().

Note: since this wrapper only exists to avoid coherence issues, it is guaranteed to be a #[repr(transparent)] wrapper around its inner I.

This is a property unsafe code can rely on: it can thus use transmute to construct it.

It is also a property that will be upheld within future versions (should this property ever be broken in the future, the change would then be a semver-breaking one, and the type would be renamed to avoid footguns).

Tuple Fields§

§0: I

Trait Implementations§

source§

impl<Item, I> Iterator for IntoIter<I>where for<'any> I: LendingIteratorඞItem<'any, T = Item> + ?Sized + LendingIterator,

§

type Item = Item

The type of the elements being iterated over.
source§

fn next(self: &mut IntoIter<I>) -> Option<Item>

Advances the iterator and returns the next value. Read more
1.0.0 · source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

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

Returns the nth element of the iterator. Read more

Auto Trait Implementations§

§

impl<I: ?Sized> RefUnwindSafe for IntoIter<I>where I: RefUnwindSafe,

§

impl<I: ?Sized> Send for IntoIter<I>where I: Send,

§

impl<I: ?Sized> Sync for IntoIter<I>where I: Sync,

§

impl<I: ?Sized> Unpin for IntoIter<I>where I: Unpin,

§

impl<I: ?Sized> UnwindSafe for IntoIter<I>where I: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<I> IntoIterator for Iwhere I: Iterator,

§

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?
const: unstable · source§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<I, IntoIter> into_lending_iter<I, IntoIter> for Iwhere I: IntoIterator<IntoIter = IntoIter>, IntoIter: Iterator,

source§

fn into_lending_iter(self) -> FromIter<IntoIter>

Extension trait based convenience method version of from_iter().