TryCollect

Trait TryCollect 

Source
pub trait TryCollect: Iterator + Sized {
    // Provided method
    fn try_collect<C: TryFromIterator<Self::Item>>(self) -> Result<C, C::Error> { ... }
}
Expand description

Extension trait for iterators that provides fallible collection.

Provided Methods§

Source

fn try_collect<C: TryFromIterator<Self::Item>>(self) -> Result<C, C::Error>

Attempts to collect elements into a collection that may fail.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§