Skip to main content

TryExtend

Trait TryExtend 

pub trait TryExtend<T> {
    // Required method
    fn try_extend<I>(&mut self, iter: I) -> Result<(), OutOfMemory>
       where I: IntoIterator<Item = T>;
}
Expand description

Analogue of Extend except handles OOM conditions.

Required Methods§

fn try_extend<I>(&mut self, iter: I) -> Result<(), OutOfMemory>
where I: IntoIterator<Item = T>,

Extends self with the items from iter.

Returns an error if allocation fails while adding items to self. If an OOM happens then some items from iter may have been added to self already. On OOM no further items from the iterator will be consumed.

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§

Source§

impl<K, V> TryExtend<V> for PrimaryMap<K, V>
where K: EntityRef,

§

impl<T> TryExtend<T> for Vec<T>