[][src]Struct iter_transpose::ResultTransposedIter

pub struct ResultTransposedIter<I, E> { /* fields omitted */ }

Result of calling IterTranspose::transpose_into_iter on Result.

Implementations

impl<I, E> ResultTransposedIter<I, E> where
    I: Iterator,
    E: Clone + Debug
[src]

pub fn take_while_ok(self) -> impl Iterator<Item = Self::Item>[src]

Returns an iterator adapter that takes elements while they are Some; shorthand for take_while(Option::is_some).

Example

assert_eq!(
    Some(vec![1, 2]).transpose_into_iter().take_while_some().collect::<Vec<_>>(),
    vec![Some(1), Some(2)],
);

pub fn unwrap_while_ok(self) -> impl Iterator<Item = I::Item>[src]

Returns an iterator adapter that takes elements while they are Some, and unwraps them.

Example

assert_eq!(
    Result::<Vec<i32>, ()>::Ok(vec![1, 2])
        .transpose_into_iter()
        .unwrap_while_ok()
        .collect::<Vec<_>>(),
    vec![1, 2],
);

Trait Implementations

impl<I, E> Iterator for ResultTransposedIter<I, E> where
    I: Iterator,
    E: Clone
[src]

type Item = Result<I::Item, E>

The type of the elements being iterated over.

Auto Trait Implementations

impl<I, E> RefUnwindSafe for ResultTransposedIter<I, E> where
    E: RefUnwindSafe,
    I: RefUnwindSafe
[src]

impl<I, E> Send for ResultTransposedIter<I, E> where
    E: Send,
    I: Send
[src]

impl<I, E> Sync for ResultTransposedIter<I, E> where
    E: Sync,
    I: Sync
[src]

impl<I, E> Unpin for ResultTransposedIter<I, E> where
    E: Unpin,
    I: Unpin
[src]

impl<I, E> UnwindSafe for ResultTransposedIter<I, E> where
    E: UnwindSafe,
    I: UnwindSafe
[src]

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<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.