pub struct Filter<I, F>where
    I: LendingIterator,
    F: FnMut(&Item<'_, I>) -> bool,{ /* private fields */ }
Expand description

The impl LendingIterator returned by .filter().

Trait Implementations§

source§

impl<'next, I, F> LendingIteratorඞItem<'next, &'next Filter<I, F>> for Filter<I, F>where I: LendingIterator, F: FnMut(&Item<'_, I>) -> bool,

§

type T = <I as LendingIteratorඞItem<'next, &'next I>>::T

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

impl<I, F> LendingIterator for Filter<I, F>where I: LendingIterator, F: FnMut(&Item<'_, I>) -> bool,

source§

fn next(self: &mut Filter<I, F>) -> Option<Item<'_, I>>

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

fn filter<F>(self, should_yield: F) -> Filter<Self, F> where Self: Sized, F: FnMut(&Item<'_, Self>) -> bool,

source§

fn for_each(self, f: impl FnMut(Item<'_, Self>))where Self: Sized,

source§

fn fold<Acc>(self, acc: Acc, f: impl FnMut(Acc, Item<'_, Self>) -> Acc) -> Accwhere Self: Sized,

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 all(&mut self, predicate: impl FnMut(Item<'_, Self>) -> bool) -> boolwhere Self: Sized,

source§

fn any(&mut self, predicate: impl FnMut(Item<'_, Self>) -> bool) -> boolwhere Self: Sized,

source§

fn by_ref(&mut self) -> &mut Self where Self: Sized,

source§

fn count(self) -> usizewhere Self: Sized,

source§

fn find<'find>( &'find mut self, predicate: impl 'find + FnMut(&Item<'_, Self>) -> bool ) -> Option<Item<'find, Self>>where Self: Sized,

source§

fn fuse(self) -> Fuse<Self> where Self: Sized,

source§

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

source§

fn position<F>( &mut self, predicate: impl FnMut(Item<'_, Self>) -> bool ) -> Option<usize>where Self: Sized,

source§

fn skip(self, count: usize) -> Skip<Self> where Self: Sized,

source§

fn take(self, count: usize) -> Take<Self> where Self: Sized,

source§

fn map<NewItemType: HKT, F>(self, f: F) -> Map<Self, F, NewItemType> where for<'next> F: FnMut([&'next Self; 0], Item<'next, Self>) -> Feed<'next, NewItemType>, Self: Sized,

source§

fn map_to_ref<R: ?Sized, F>(self, f: F) -> Map<Self, F, HKTRef<R>> where for<'any> F: FnMut([&'any Self; 0], Item<'any, Self>) -> &'any R, Self: Sized,

Convenience method: same as .map(), but for hard-coding the HKT parameter to HKTRef<R> = HKT!(&R). Read more
source§

fn map_to_mut<R: ?Sized, F>(self, f: F) -> Map<Self, F, HKTRefMut<R>> where for<'any> F: FnMut([&'any Self; 0], Item<'any, Self>) -> &'any mut R, Self: Sized,

Convenience method: same as .map(), but for hard-coding the HKT parameter to HKTRefMut<R> = HKT!(&mut R). Read more
source§

fn map_into_iter<F, NonLendingItem>(self, f: F) -> MapIntoIter<Self, F> where F: FnMut(Item<'_, Self>) -> NonLendingItem, Self: Sized,

Convenience shorthand for .map…(…).into_iter(). Read more
source§

fn filter_map<NewItemType: HKT, F>( self, f: F ) -> FilterMap<Self, F, NewItemType> where for<'next> F: FnMut([&'next Self; 0], Item<'next, Self>) -> Option<Feed<'next, NewItemType>>, Self: Sized,

source§

fn filter_map_to_ref<R: ?Sized, F>(self, f: F) -> FilterMap<Self, F, HKTRef<R>> where for<'any> F: FnMut([&'any Self; 0], Item<'any, Self>) -> Option<&'any R>, Self: Sized,

Convenience method: same as .filter_map(), but for hard-coding the HKT parameter to HKTRef<R> = HKT!(&R). Read more
source§

fn filter_map_to_mut<R: ?Sized, F>( self, f: F ) -> FilterMap<Self, F, HKTRefMut<R>> where for<'any> F: FnMut([&'any Self; 0], Item<'any, Self>) -> Option<&'any mut R>, Self: Sized,

Convenience method: same as .filter_map(), but for hard-coding the HKT parameter to HKTRefMut<R> = HKT!(&mut R). Read more
source§

fn filter_map_into_iter<F, NonLendingItem>( self, f: F ) -> FilterMapIntoIter<Self, F> where F: FnMut(Item<'_, Self>) -> Option<NonLendingItem>, Self: Sized,

Convenience shorthand for .filter_map…(…).into_iter(). Read more
source§

fn into_iter<Item>(self) -> IntoIter<Self> where Self: for<'any> LendingIteratorඞItem<'any, T = Item> + Sized,

Convert a Self : LendingIterator into an Iterator, provided Self::Item<'_> does not depend on '_.
source§

fn dyn_boxed<'usability>( self ) -> Box<dyn LendingIteratorDyn<Item = HKTItem<Self>> + 'usability>where Self: 'usability + Sized,

Available on crate feature alloc only.
Converts this LendingIterator into a Box<dyn LendingIteratorDyn…>. Read more
source§

fn dyn_boxed_auto<BoxedDynLendingIterator, Item: HKT>( self ) -> BoxedDynLendingIteratorwhere Self: Sized + DynCoerce<BoxedDynLendingIterator, Item>,

Available on crate feature alloc only.
Converts this LendingIterator into a Box<dyn LendingIteratorDyn…>. Read more

Auto Trait Implementations§

§

impl<I, F> RefUnwindSafe for Filter<I, F>where F: RefUnwindSafe, I: RefUnwindSafe,

§

impl<I, F> Send for Filter<I, F>where F: Send, I: Send,

§

impl<I, F> Sync for Filter<I, F>where F: Sync, I: Sync,

§

impl<I, F> Unpin for Filter<I, F>where F: Unpin, I: Unpin,

§

impl<I, F> UnwindSafe for Filter<I, F>where F: UnwindSafe, 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.