Struct WithPosition

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

An iterator adaptor that wraps each element in an Position.

Iterator element type is (Position, I::Item).

See .with_position() for more information.

Trait Implementations

impl<I> Clone for WithPosition<I> where I: Clone + Iterator, I::Item: Clone,

fn clone(&self) -> Self

impl<I> Debug for WithPosition<I> where I: Iterator, Peekable<Fuse<I>>: Debug,

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

impl<I> ExactSizeIterator for WithPosition<I> where I: ExactSizeIterator,

impl<I: Iterator> FusedIterator for WithPosition<I>

impl<I: Iterator> Iterator for WithPosition<I>

type Item = (Position, <I as Iterator>::Item);
fn next(&mut self) -> Option<Self::Item>
fn size_hint(&self) -> (usize, Option<usize>)
fn fold<B, F>(self, init: B, f: F) -> B
where
    F: FnMut(B, Self::Item) -> B,

Auto Trait Implementations

impl<I> Freeze for WithPosition<I> where Peekable<Fuse<I>>: Freeze,

impl<I> RefUnwindSafe for WithPosition<I> where Peekable<Fuse<I>>: RefUnwindSafe,

impl<I> Send for WithPosition<I> where Peekable<Fuse<I>>: Send,

impl<I> Sync for WithPosition<I> where Peekable<Fuse<I>>: Sync,

impl<I> Unpin for WithPosition<I> where Peekable<Fuse<I>>: Unpin,

impl<I> UnsafeUnpin for WithPosition<I> where Peekable<Fuse<I>>: UnsafeUnpin,

impl<I> UnwindSafe for WithPosition<I> where Peekable<Fuse<I>>: UnwindSafe,

Blanket Implementations

impl<I> IntoIterator for WithPosition<I> where I: Iterator,

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

impl<IT, A, FromA, B, FromB> MultiUnzip<(FromA, FromB)> for WithPosition<I> where IT: Iterator<Item = (A, B)>, FromA: Default + Extend<A>, FromB: Default + Extend<B>,

fn multiunzip(self) -> (FromA, FromB)

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> CloneToUninit for WithPosition<I> where T: Clone,

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

impl<T> From<T> for WithPosition<I>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> IntoEither for WithPosition<I>

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

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

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

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

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

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

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