Struct Positions

#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
pub struct Positions<I, F> { /* private fields */ }

An iterator adapter to get the positions of each element that matches a predicate.

See .positions() for more information.

Trait Implementations

impl<I, F> Debug for Positions<I, F> where I: Debug,

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

impl<I, F> DoubleEndedIterator for Positions<I, F> where I: DoubleEndedIterator + ExactSizeIterator, F: FnMut(I::Item) -> bool,

fn next_back(&mut self) -> Option<Self::Item>
fn rfold<B, G>(self, init: B, func: G) -> B
where
    G: FnMut(B, Self::Item) -> B,

impl<I, F> FusedIterator for Positions<I, F> where I: FusedIterator, F: FnMut(I::Item) -> bool,

impl<I, F> Iterator for Positions<I, F> where I: Iterator, F: FnMut(I::Item) -> bool,

type Item = usize;
fn next(&mut self) -> Option<Self::Item>
fn size_hint(&self) -> (usize, Option<usize>)
fn fold<B, G>(self, init: B, func: G) -> B
where
    G: FnMut(B, Self::Item) -> B,

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

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

Auto Trait Implementations

impl<I, F> Freeze for Positions<I, F> where Enumerate<I>: Freeze, F: Freeze,

impl<I, F> RefUnwindSafe for Positions<I, F> where Enumerate<I>: RefUnwindSafe, F: RefUnwindSafe,

impl<I, F> Send for Positions<I, F> where Enumerate<I>: Send, F: Send,

impl<I, F> Sync for Positions<I, F> where Enumerate<I>: Sync, F: Sync,

impl<I, F> Unpin for Positions<I, F> where Enumerate<I>: Unpin, F: Unpin,

impl<I, F> UnsafeUnpin for Positions<I, F> where Enumerate<I>: UnsafeUnpin, F: UnsafeUnpin,

impl<I, F> UnwindSafe for Positions<I, F> where Enumerate<I>: UnwindSafe, F: UnwindSafe,

Blanket Implementations

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

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

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

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

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

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

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> IntoEither for Positions<I, F>

impl<T> Itertools for Positions<I, F> where T: Iterator + ?Sized,

impl<T> ToOwned for Positions<I, F> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

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

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

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

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