[][src]Struct skip_do::SkipDoIterator

pub struct SkipDoIterator<I: Iterator, S: Fn(&I::Item) -> bool, W: FnMut(I::Item)> { /* fields omitted */ }

An iterator that skip items and use skipped items.

use skip_do::SkipDo;

let mut v = vec![1, 2, 3, 4];
let mut v2 = vec![];

v = v
    .into_iter()
    .skip_do(|x| x <= &2, |x| v2.push(x))
    .map(|x| x)
    .collect();

assert_eq!(v, [3, 4]);
assert_eq!(v2, [1, 2]);

Trait Implementations

impl<IT: Iterator, F: Fn(&IT::Item) -> bool, DO: FnMut(IT::Item)> Iterator for SkipDoIterator<IT, F, DO>[src]

type Item = IT::Item

The type of the elements being iterated over.

Auto Trait Implementations

impl<I, S, W> RefUnwindSafe for SkipDoIterator<I, S, W> where
    I: RefUnwindSafe,
    S: RefUnwindSafe,
    W: RefUnwindSafe,
    <I as Iterator>::Item: RefUnwindSafe

impl<I, S, W> Send for SkipDoIterator<I, S, W> where
    I: Send,
    S: Send,
    W: Send,
    <I as Iterator>::Item: Send

impl<I, S, W> Sync for SkipDoIterator<I, S, W> where
    I: Sync,
    S: Sync,
    W: Sync,
    <I as Iterator>::Item: Sync

impl<I, S, W> Unpin for SkipDoIterator<I, S, W> where
    I: Unpin,
    S: Unpin,
    W: Unpin,
    <I as Iterator>::Item: Unpin

impl<I, S, W> UnwindSafe for SkipDoIterator<I, S, W> where
    I: UnwindSafe,
    S: UnwindSafe,
    W: UnwindSafe,
    <I as Iterator>::Item: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<IT> SkipDo for IT where
    IT: Iterator
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.