pub struct MapRefAnd<I, F, R: 'static, T> { /* private fields */ }
Expand description

Iterator adapter to map to a combination of a reference into the original Iterator and also a new object.

see Streaming::map_ref_and

Trait Implementations§

source§

impl<I, F, R, T> Clone for MapRefAnd<I, F, R, T>
where I: StreamingIterator + Clone, T: Clone, F: Clone + for<'a> Fn(&'a I::Item) -> RefAnd<'a, R, T>,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<I: Debug, F: Debug, R: Debug + 'static, T: Debug> Debug for MapRefAnd<I, F, R, T>

source§

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

Formats the value using the given formatter. Read more
source§

impl<I, F, R: 'static, T> StreamingIterator for MapRefAnd<I, F, R, T>
where I: StreamingIterator, F: for<'a> FnMut(&'a I::Item) -> RefAnd<'a, R, T>,

§

type Item = RefAnd<'static, R, T>

The type of the elements being iterated over.
source§

fn advance(&mut self)

Advances the iterator to the next element. Read more
source§

fn get(&self) -> Option<&Self::Item>

Returns a reference to the current element of the iterator. Read more
source§

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

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

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

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

fn is_done(&self) -> bool

Checks if get() will return None.
source§

fn all<F>(&mut self, f: F) -> bool
where Self: Sized, F: FnMut(&Self::Item) -> bool,

Determines if all elements of the iterator satisfy a predicate.
source§

fn any<F>(&mut self, f: F) -> bool
where Self: Sized, F: FnMut(&Self::Item) -> bool,

Determines if any elements of the iterator satisfy a predicate.
source§

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

Borrows an iterator, rather than consuming it. Read more
source§

fn chain<I>(self, other: I) -> Chain<Self, I>
where Self: Sized, I: StreamingIterator<Item = Self::Item>,

Consumes two iterators and returns a new iterator that iterates over both in sequence.
source§

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

Consumes the iterator, counting the number of remaining elements and returning it.
source§

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

Creates an iterator which uses a closure to determine if an element should be yielded.
source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, B, F>
where Self: Sized, F: FnMut(&Self::Item) -> Option<B>,

Creates an iterator which both filters and maps by applying a closure to elements.
source§

fn flat_map<J, F>(self, f: F) -> FlatMap<Self, J, F>
where Self: Sized, J: StreamingIterator, F: FnMut(&Self::Item) -> J,

Creates an iterator which flattens iterators obtained by applying a closure to elements. Note that the returned iterators must be streaming iterators.
source§

fn filter_map_deref<B, F>(self, f: F) -> FilterMapDeref<Self, F>
where Self: Sized, F: FnMut(&Self::Item) -> Option<B>,

Creates a regular, non-streaming iterator which both filters and maps by applying a closure to elements.
source§

fn find<F>(&mut self, f: F) -> Option<&Self::Item>
where Self: Sized, F: FnMut(&Self::Item) -> bool,

Returns the first element of the iterator that satisfies the predicate.
source§

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

Creates an iterator which is “well behaved” at the beginning and end of iteration. Read more
source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where F: FnMut(&Self::Item), Self: Sized,

Call a closure on each element, passing the element on. The closure is called upon calls to advance or advance_back, and exactly once per element regardless of how many times (if any) get is called.
source§

fn map<B, F>(self, f: F) -> Map<Self, B, F>
where Self: Sized, F: FnMut(&Self::Item) -> B,

Creates an iterator which transforms elements of this iterator by passing them to a closure.
source§

fn map_deref<B, F>(self, f: F) -> MapDeref<Self, F>
where Self: Sized, F: FnMut(&Self::Item) -> B,

Creates a regular, non-streaming iterator which transforms elements of this iterator by passing them to a closure.
source§

fn map_ref<B, F>(self, f: F) -> MapRef<Self, F>
where Self: Sized, F: Fn(&Self::Item) -> &B, B: ?Sized,

Creates an iterator which transforms elements of this iterator by passing them to a closure. Read more
source§

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

Consumes the first n elements of the iterator, returning the next one.
source§

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

Returns the index of the first element of the iterator matching a predicate.
source§

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

Creates an iterator which skips the first n elements.
source§

fn skip_while<F>(self, f: F) -> SkipWhile<Self, F>
where Self: Sized, F: FnMut(&Self::Item) -> bool,

Creates an iterator that skips initial elements matching a predicate.
source§

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

Creates an iterator which only returns the first n elements.
source§

fn take_while<F>(self, f: F) -> TakeWhile<Self, F>
where Self: Sized, F: FnMut(&Self::Item) -> bool,

Creates an iterator which only returns initial elements matching a predicate.
source§

fn fold<B, F>(self, init: B, f: F) -> B
where Self: Sized, F: FnMut(B, &Self::Item) -> B,

Reduces the iterator’s elements to a single, final value.
source§

fn for_each<F>(self, f: F)
where Self: Sized, F: FnMut(&Self::Item),

Calls a closure on each element of an iterator.

Auto Trait Implementations§

§

impl<I, F, R, T> RefUnwindSafe for MapRefAnd<I, F, R, T>

§

impl<I, F, R, T> Send for MapRefAnd<I, F, R, T>
where F: Send, I: Send, R: Sync, T: Send,

§

impl<I, F, R, T> Sync for MapRefAnd<I, F, R, T>
where F: Sync, I: Sync, R: Sync, T: Sync,

§

impl<I, F, R, T> Unpin for MapRefAnd<I, F, R, T>
where F: Unpin, I: Unpin, T: Unpin,

§

impl<I, F, R, T> UnwindSafe for MapRefAnd<I, F, R, T>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

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> Streaming for I

source§

fn enumerate(self) -> Enumerate<Self>

Creates a StreamingIterator that gives the current iteration count and Item. Read more
source§

fn zip<J: StreamingIterator>(self, j: J) -> Zip<Self, J>

‘Zips up’ two streaming iterators into a single streaming iterator of pairs. Read more
source§

fn map_ref_and<F, R, T>(self, f: F) -> MapRefAnd<Self, F, R, T>
where F: for<'a> FnMut(&'a Self::Item) -> RefAnd<'a, R, T>,

Maps a streaming iterator over one type to one over another by applying a closure. Read more
source§

fn map_mut_and<F, R, T>(self, f: F) -> MapMutRefAnd<Self, F, R, T>
where F: for<'a> FnMut(&'a mut Self::Item) -> MutRefAnd<'a, R, T>,

Streaming::map_ref_and with a mutable pointer back for StreamingIteratorMuts. Read more
source§

fn combinations_with<'a, J, F>( &'a mut self, f: F ) -> MutRefAnd<'a, Self, Combinations<J, F>>
where J: StreamingIterator, F: FnMut() -> J,

Streaming iterator over all pairs of one Item from self and one from a second iterator generated by a function.
source§

fn inner_combinations<T, F, S>( self, target: T, f: F, stack: S ) -> InnerCombinations<T, F, S>
where Self: Clone, F: Fn(&Self::Item) -> T, S: Stack<Item = Self>, T: AddAssign<T> + SubAssign<T> + Ord + Clone,

Streaming iterator adapter to find selections of items from one cloneable streaming iterator. Read more
source§

fn cfilter<F: FnMut(&Self::Item) -> bool>(self, f: F) -> CFilter<Self, F>

A copy of StreamingIterator::filter where the output derives Clone
source§

fn cmap<F: FnMut(&Self::Item) -> B, B>(self, f: F) -> CMap<Self, F, B>

A copy of StreamingIterator::map where the output derives Clone
source§

fn cflat_map<F, J>(self, f: F) -> CFlatMap<Self, F, J>
where J: StreamingIterator, F: FnMut(&Self::Item) -> J,

A copy of StreamingIterator::flat_map where the output derives Clone
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.