#[repr(transparent)]
pub struct FromIter<I: ?Sized + Iterator>(pub I);
Expand description

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<'__, I: ?Sized + Iterator> LendingIteratorඞItem<'__, &'__ FromIter<I>> for FromIter<I>

§

type T = <I as Iterator>::Item

The “output” of this whole hand-rolled GAT: think of LendingIteratorඞItem<'lt>::T as of LendingIterator::Item<'lt>. Read more
source§

impl<I: ?Sized + Iterator> LendingIterator for FromIter<I>

source§

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

Query the next() Item of this Self iterator. Read more
source§

fn try_for_each<Err>( &mut self, f: impl FnMut(Item<'_, Self>) -> Result<(), Err> ) -> Result<(), Err>

source§

fn try_fold<Acc, Err>( &mut self, acc: Acc, f: impl FnMut(Acc, Item<'_, Self>) -> Result<Acc, Err> ) -> Result<Acc, Err>

source§

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

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<I: ?Sized> UnwindSafe for FromIter<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<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.