#[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 for FromIter<I>
impl<I: ?Sized + Iterator> LendingIterator for FromIter<I>
Source§fn filter<F>(self, should_yield: F) -> Filter<Self, F> ⓘ
fn filter<F>(self, should_yield: F) -> Filter<Self, F> ⓘ
LendingIterator
counterpart of Iterator::filter()
.Source§fn for_each(self, f: impl FnMut(Item<'_, Self>))where
Self: Sized,
fn for_each(self, f: impl FnMut(Item<'_, Self>))where
Self: Sized,
LendingIterator
counterpart of Iterator::for_each()
.Source§fn fold<Acc>(self, acc: Acc, f: impl FnMut(Acc, Item<'_, Self>) -> Acc) -> Accwhere
Self: Sized,
fn fold<Acc>(self, acc: Acc, f: impl FnMut(Acc, Item<'_, Self>) -> Acc) -> Accwhere
Self: Sized,
LendingIterator
counterpart of Iterator::fold()
.Source§fn try_for_each<Err>(
&mut self,
f: impl FnMut(Item<'_, Self>) -> Result<(), Err>,
) -> Result<(), Err>
fn try_for_each<Err>( &mut self, f: impl FnMut(Item<'_, Self>) -> Result<(), Err>, ) -> Result<(), Err>
LendingIterator
counterpart of Iterator::try_for_each()
.Source§fn try_fold<Acc, Err>(
&mut self,
acc: Acc,
f: impl FnMut(Acc, Item<'_, Self>) -> Result<Acc, Err>,
) -> Result<Acc, Err>
fn try_fold<Acc, Err>( &mut self, acc: Acc, f: impl FnMut(Acc, Item<'_, Self>) -> Result<Acc, Err>, ) -> Result<Acc, Err>
LendingIterator
counterpart of Iterator::try_fold()
.Source§fn all(&mut self, predicate: impl FnMut(Item<'_, Self>) -> bool) -> boolwhere
Self: Sized,
fn all(&mut self, predicate: impl FnMut(Item<'_, Self>) -> bool) -> boolwhere
Self: Sized,
LendingIterator
counterpart of Iterator::all()
.Source§fn any(&mut self, predicate: impl FnMut(Item<'_, Self>) -> bool) -> boolwhere
Self: Sized,
fn any(&mut self, predicate: impl FnMut(Item<'_, Self>) -> bool) -> boolwhere
Self: Sized,
LendingIterator
counterpart of Iterator::any()
.Source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
LendingIterator
counterpart of Iterator::by_ref()
.Source§fn count(self) -> usizewhere
Self: Sized,
fn count(self) -> usizewhere
Self: Sized,
LendingIterator
counterpart of Iterator::count()
.Source§fn find<'find>(
&'find mut self,
predicate: impl 'find + FnMut(&Item<'_, Self>) -> bool,
) -> Option<Item<'find, Self>>where
Self: Sized,
fn find<'find>(
&'find mut self,
predicate: impl 'find + FnMut(&Item<'_, Self>) -> bool,
) -> Option<Item<'find, Self>>where
Self: Sized,
LendingIterator
counterpart of Iterator::find()
.Source§fn fuse(self) -> Fuse<Self> ⓘwhere
Self: Sized,
fn fuse(self) -> Fuse<Self> ⓘwhere
Self: Sized,
LendingIterator
counterpart of Iterator::fuse()
.Source§fn nth(&mut self, n: usize) -> Option<Item<'_, Self>>
fn nth(&mut self, n: usize) -> Option<Item<'_, Self>>
LendingIterator
counterpart of Iterator::nth()
.Source§fn position<F>(
&mut self,
predicate: impl FnMut(Item<'_, Self>) -> bool,
) -> Option<usize>where
Self: Sized,
fn position<F>(
&mut self,
predicate: impl FnMut(Item<'_, Self>) -> bool,
) -> Option<usize>where
Self: Sized,
LendingIterator
counterpart of Iterator::position()
.Source§fn skip(self, count: usize) -> Skip<Self> ⓘwhere
Self: Sized,
fn skip(self, count: usize) -> Skip<Self> ⓘwhere
Self: Sized,
LendingIterator
counterpart of Iterator::skip()
.Source§fn take(self, count: usize) -> Take<Self> ⓘwhere
Self: Sized,
fn take(self, count: usize) -> Take<Self> ⓘwhere
Self: Sized,
LendingIterator
counterpart of Iterator::take()
.Source§fn map_into_iter<F, NonLendingItem>(self, f: F) -> MapIntoIter<Self, F> ⓘ
fn map_into_iter<F, NonLendingItem>(self, f: F) -> MapIntoIter<Self, F> ⓘ
Convenience shorthand for
.map…(…).into_iter()
. Read moreSource§fn filter_map_to_ref<R: ?Sized, F>(self, f: F) -> FilterMap<Self, F, HKTRef<R>> ⓘ
fn filter_map_to_ref<R: ?Sized, F>(self, f: F) -> FilterMap<Self, F, HKTRef<R>> ⓘ
Convenience method: same as
.filter_map()
, but for hard-coding the
HKT
parameter to HKTRef<R> = HKT!(&R)
. Read moreSource§fn filter_map_to_mut<R: ?Sized, F>(
self,
f: F,
) -> FilterMap<Self, F, HKTRefMut<R>> ⓘ
fn filter_map_to_mut<R: ?Sized, F>( self, f: F, ) -> FilterMap<Self, F, HKTRefMut<R>> ⓘ
Convenience method: same as
.filter_map()
, but for hard-coding the
HKT
parameter to HKTRefMut<R> = HKT!(&mut R)
. Read moreSource§fn filter_map_into_iter<F, NonLendingItem>(
self,
f: F,
) -> FilterMapIntoIter<Self, F> ⓘ
fn filter_map_into_iter<F, NonLendingItem>( self, f: F, ) -> FilterMapIntoIter<Self, F> ⓘ
Convenience shorthand for
.filter_map…(…).into_iter()
. Read moreSource§fn into_iter<Item>(self) -> IntoIter<Self> ⓘwhere
Self: for<'any> LendingIteratorඞItem<'any, T = Item> + Sized,
fn into_iter<Item>(self) -> IntoIter<Self> ⓘwhere
Self: for<'any> LendingIteratorඞItem<'any, T = Item> + Sized,
Source§fn dyn_boxed<'usability>(
self,
) -> Box<dyn LendingIteratorDyn<Item = HKTItem<Self>> + 'usability>where
Self: 'usability + Sized,
fn dyn_boxed<'usability>(
self,
) -> Box<dyn LendingIteratorDyn<Item = HKTItem<Self>> + 'usability>where
Self: 'usability + Sized,
Available on crate feature
alloc
only.Source§fn dyn_boxed_auto<BoxedDynLendingIterator, Item: HKT>(
self,
) -> BoxedDynLendingIteratorwhere
Self: Sized + DynCoerce<BoxedDynLendingIterator, Item>,
fn dyn_boxed_auto<BoxedDynLendingIterator, Item: HKT>(
self,
) -> BoxedDynLendingIteratorwhere
Self: Sized + DynCoerce<BoxedDynLendingIterator, Item>,
Available on crate feature
alloc
only.Auto Trait Implementations§
impl<I> Freeze for FromIter<I>
impl<I> RefUnwindSafe for FromIter<I>where
I: RefUnwindSafe + ?Sized,
impl<I> Send for FromIter<I>
impl<I> Sync for FromIter<I>
impl<I> Unpin for FromIter<I>
impl<I> UnwindSafe for FromIter<I>where
I: UnwindSafe + ?Sized,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more