Extend

Trait Extend 

Source
pub trait Extend {
    type Item;

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

Abstracts something which can extend an &mut self.

Required Associated Types§

Source

type Item

item of the collection

Required Methods§

Source

fn extend<Items>(&mut self, items: Items)
where Items: IntoIterator<Item = Self::Item>,

Used to extend 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 Extend for ()

Source§

type Item = ()

Source§

fn extend<Items>(&mut self, _items: Items)
where Items: IntoIterator<Item = Self::Item>,

Source§

impl Extend for String

Available on crate feature alloc only.
Source§

type Item = char

Source§

fn extend<Items>(&mut self, items: Items)
where Items: IntoIterator<Item = Self::Item>,

Source§

impl<Item> Extend for LinkedList<Item>

Available on crate feature alloc only.
Source§

type Item = Item

Source§

fn extend<Items>(&mut self, items: Items)
where Items: IntoIterator<Item = Self::Item>,

Source§

impl<Item> Extend for VecDeque<Item>

Available on crate feature alloc only.
Source§

type Item = Item

Source§

fn extend<Items>(&mut self, items: Items)
where Items: IntoIterator<Item = Self::Item>,

Source§

impl<Item> Extend for Vec<Item>

Available on crate feature alloc only.
Source§

type Item = Item

Source§

fn extend<Items>(&mut self, items: Items)
where Items: IntoIterator<Item = Item>,

Source§

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

Available on crate feature smallvec only.
Source§

type Item = Item

Source§

fn extend<Items>(&mut self, items: Items)
where Items: IntoIterator<Item = Self::Item>,

Source§

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

Available on crate feature hashmap only.
Source§

type Item = Item

Source§

fn extend<Items>(&mut self, items: Items)
where Items: IntoIterator<Item = Self::Item>,

Source§

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

Available on crate feature alloc only.
Source§

type Item = Item

Source§

fn extend<Items>(&mut self, items: Items)
where Items: IntoIterator<Item = Self::Item>,

Source§

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

Available on crate feature alloc only.
Source§

type Item = Item

Source§

fn extend<Items>(&mut self, items: Items)
where Items: IntoIterator<Item = Self::Item>,

Source§

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

Available on crate feature hashmap only.
Source§

type Item = (Key, Value)

Source§

fn extend<Items>(&mut self, items: Items)
where Items: IntoIterator<Item = Self::Item>,

Source§

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

Available on crate feature alloc only.
Source§

type Item = (Key, Value)

Source§

fn extend<Items>(&mut self, items: Items)
where Items: IntoIterator<Item = Self::Item>,

Implementors§