pub trait FromFallibleIterator<T>: Sized {
// Required method
fn from_fallible_iter<I, E>(iter: I) -> Result<Self, E>
where I: IntoIterator<Item = Result<T, E>>;
}Expand description
Extension to FromIterator for fallible initialization.
Required Methods§
Sourcefn from_fallible_iter<I, E>(iter: I) -> Result<Self, E>where
I: IntoIterator<Item = Result<T, E>>,
fn from_fallible_iter<I, E>(iter: I) -> Result<Self, E>where
I: IntoIterator<Item = Result<T, E>>,
Initializes a new collection from a fallible iterator.
If the iterator returns an error or panics while initializing the sequence, any already initialized elements will be dropped and the error returned.
This is equivalent to iter.collect::<Result<GenericArray<T, N>, E>>() except
it won’t panic due to Result::from_iter truncating the underlying iterator
if an error occurs, leading to a length mismatch.
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.