Skip to main content

TryFromIterator

Trait TryFromIterator 

Source
pub trait TryFromIterator<T, E>: Sized {
    // Required method
    fn try_from_iter<I>(iter: I) -> Result<Self, E>
       where I: Iterator<Item = T>;
}
Expand description

Analogue of FromIterator in the standard library, but used with TryCollect::try_collect instead.

Required Methods§

Source

fn try_from_iter<I>(iter: I) -> Result<Self, E>
where I: Iterator<Item = T>,

Creates an intance of this collection from the iter provided.

Does not abort on OOM but insteads return an error.

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.

Implementations on Foreign Types§

Source§

impl<T> TryFromIterator<T, OutOfMemory> for Box<[T]>

Source§

fn try_from_iter<I>(iter: I) -> Result<Self, OutOfMemory>
where I: Iterator<Item = T>,

Source§

impl<T, E> TryFromIterator<Result<T, E>, E> for Box<[T]>
where E: From<OutOfMemory>,

Source§

fn try_from_iter<I>(iter: I) -> Result<Self, E>
where I: Iterator<Item = Result<T, E>>,

Implementors§

Source§

impl<T> TryFromIterator<T, OutOfMemory> for Vec<T>

Source§

impl<T, E> TryFromIterator<Result<T, E>, E> for Vec<T>
where E: From<OutOfMemory>,