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>
fn try_collect<B, E>(self) -> Result<B, E>
Attempts to collect the iterator self into B.
Same as Iterator::collect except returns OOM instead of aborting.