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§
Sourcefn try_collect<C: TryFromIterator<Self::Item>>(self) -> Result<C, C::Error>
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.