TryExtend

Trait TryExtend 

Source
pub trait TryExtend {
    type Item;

    // Required method
    fn try_extend<Items>(&mut self, items: Items) -> Result<(), TryReserveError>
       where Items: IntoIterator<Item = Self::Item>;
}
Expand description

Abstracts something which can try extend &mut self.

Required Associated Types§

Source

type Item

Item stocked in the collection

Required Methods§

Source

fn try_extend<Items>(&mut self, items: Items) -> Result<(), TryReserveError>
where Items: IntoIterator<Item = Self::Item>,

Used to expect a collection with an IntoIterator object.

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 TryExtend for ()

Available on crate feature alloc only.
Source§

type Item = ()

Source§

fn try_extend<Items>(&mut self, _items: Items) -> Result<(), TryReserveError>
where Items: IntoIterator<Item = Self::Item>,

Source§

impl TryExtend for String

Available on crate feature alloc only.
Source§

type Item = char

Source§

fn try_extend<Items>(&mut self, items: Items) -> Result<(), TryReserveError>
where Items: IntoIterator<Item = Self::Item>,

Source§

impl<Item> TryExtend for LinkedList<Item>

Available on crate feature alloc only.
Source§

type Item = Item

Source§

fn try_extend<Items>(&mut self, items: Items) -> Result<(), TryReserveError>
where Items: IntoIterator<Item = Self::Item>,

Source§

impl<Item> TryExtend for VecDeque<Item>

Available on crate feature alloc only.
Source§

type Item = Item

Source§

fn try_extend<Items>(&mut self, items: Items) -> Result<(), TryReserveError>
where Items: IntoIterator<Item = Self::Item>,

Source§

impl<Item> TryExtend for Vec<Item>

Available on crate feature alloc only.
Source§

type Item = Item

Source§

fn try_extend<Items>(&mut self, items: Items) -> Result<(), TryReserveError>
where Items: IntoIterator<Item = Item>,

Source§

impl<Item, const N: usize> TryExtend for SmallVec<[Item; N]>

Available on crate feature smallvec only.
Source§

type Item = Item

Source§

fn try_extend<Items>(&mut self, items: Items) -> Result<(), TryReserveError>
where Items: IntoIterator<Item = Self::Item>,

Source§

impl<Item: Eq + Hash, Seed: BuildHasher> TryExtend for HashSet<Item, Seed>

Available on crate feature hashmap only.
Source§

type Item = Item

Source§

fn try_extend<Items>(&mut self, items: Items) -> Result<(), TryReserveError>
where Items: IntoIterator<Item = Self::Item>,

Source§

impl<Item: Ord> TryExtend for BinaryHeap<Item>

Available on crate feature alloc only.
Source§

type Item = Item

Source§

fn try_extend<Items>(&mut self, items: Items) -> Result<(), TryReserveError>
where Items: IntoIterator<Item = Self::Item>,

Source§

impl<Item: Ord> TryExtend for BTreeSet<Item>

Available on crate feature alloc only.
Source§

type Item = Item

Source§

fn try_extend<Items>(&mut self, items: Items) -> Result<(), TryReserveError>
where Items: IntoIterator<Item = Self::Item>,

Source§

impl<Key: Eq + Hash, Value, Seed: BuildHasher> TryExtend for HashMap<Key, Value, Seed>

Available on crate feature hashmap only.
Source§

type Item = (Key, Value)

Source§

fn try_extend<Items>(&mut self, items: Items) -> Result<(), TryReserveError>
where Items: IntoIterator<Item = Self::Item>,

Source§

impl<Key: Ord, Value> TryExtend for BTreeMap<Key, Value>

Available on crate feature alloc only.
Source§

type Item = (Key, Value)

Source§

fn try_extend<Items>(&mut self, items: Items) -> Result<(), TryReserveError>
where Items: IntoIterator<Item = Self::Item>,

Implementors§