Skip to main content

TryCollect

Trait TryCollect 

pub trait TryCollect: Iterator {
    // Provided method
    fn try_collect<B, E>(self) -> Result<B, E>
       where B: TryFromIterator<Self::Item, E>,
             Self: Sized { ... }
}
Expand description

Extension trait for an Iterator to fallibly collect into a container.

Provided Methods§

fn try_collect<B, E>(self) -> Result<B, E>
where B: TryFromIterator<Self::Item, E>, Self: Sized,

Attempts to collect the iterator self into B.

Same as Iterator::collect except returns OOM instead of aborting.

Implementors§

§

impl<I> TryCollect for I
where I: Iterator,