Struct FilterMap

#[must_use = "iterators are lazy and do nothing unless consumed"]
pub struct FilterMap<I, F> { pub(in ::iter::adapters::filter_map) iter: I, pub(in ::iter::adapters::filter_map) f: F }

An iterator that uses f to both filter and map elements from iter.

This struct is created by the filter_map method on Iterator. See its documentation for more.

Fields

iter: I
f: F

Implementations

impl<I, F> FilterMap<I, F>

const fn new(iter: I, f: F) -> FilterMap<I, F>

Trait Implementations

impl<B, I: DoubleEndedIterator, F> DoubleEndedIterator for FilterMap<I, F> where F: FnMut(I::Item) -> Option<B>,

fn next_back(&mut self) -> Option<B>
fn try_rfold<Acc, Fold, R>(&mut self, init: Acc, fold: Fold) -> R
where
    Self: Sized,
    Fold: FnMut(Acc, Self::Item) -> R,
    R: Try<Output = Acc>,
fn rfold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc
where
    Fold: FnMut(Acc, Self::Item) -> Acc,

impl<B, I: FusedIterator, F> FusedIterator for FilterMap<I, F> where F: FnMut(I::Item) -> Option<B>,

impl<B, I: Iterator, F> Iterator for FilterMap<I, F> where F: FnMut(I::Item) -> Option<B>,

type Item = B;
fn next(&mut self) -> Option<B>
fn next_chunk<const N: usize>(&mut self) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
fn size_hint(&self) -> (usize, Option<usize>)
fn try_fold<Acc, Fold, R>(&mut self, init: Acc, fold: Fold) -> R
where
    Self: Sized,
    Fold: FnMut(Acc, Self::Item) -> R,
    R: Try<Output = Acc>,
fn fold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc
where
    Fold: FnMut(Acc, Self::Item) -> Acc,

impl<I, F> SourceIter for FilterMap<I, F> where I: SourceIter,

type Source = <I as SourceIter>::Source;
unsafe fn as_inner(&mut self) -> &mut I::Source

impl<I: Clone, F: Clone> Clone for FilterMap<I, F>

fn clone(&self) -> FilterMap<I, F>

impl<I: Debug, F> Debug for FilterMap<I, F>

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

impl<I: InPlaceIterable, F> InPlaceIterable for FilterMap<I, F>

const EXPAND_BY: Option<NonZero<usize>> = I::EXPAND_BY;
const MERGE_BY: Option<NonZero<usize>> = I::MERGE_BY;

impl<I: OneShot, P> OneShot for FilterMap<I, P>

impl<I: TrustedFused, F> TrustedFused for FilterMap<I, F>

Auto Trait Implementations

impl<I, F> Freeze for FilterMap<I, F> where I: Freeze, F: Freeze,

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

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

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

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

impl<I, F> UnsafeUnpin for FilterMap<I, F> where I: UnsafeUnpin, F: UnsafeUnpin,

impl<I, F> UnwindSafe for FilterMap<I, F> where I: UnwindSafe, F: UnwindSafe,

Blanket Implementations

impl<I> IntoIterator for FilterMap<I, F> where I: Iterator,

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

impl<T> Any for FilterMap<I, F> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for FilterMap<I, F> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for FilterMap<I, F> where T: ?Sized,

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

impl<T> CloneToUninit for FilterMap<I, F> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for FilterMap<I, F>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for FilterMap<I, F> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for FilterMap<I, F>

impl<T, U> Into<U> for FilterMap<I, F> 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 FilterMap<I, F> where U: Into<T>,

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

impl<T, U> TryInto<U> for FilterMap<I, F> where U: TryFrom<T>,

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