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§
Required Methods§
Sourcefn try_extend<Items>(&mut self, items: Items) -> Result<(), TryReserveError>where
Items: IntoIterator<Item = Self::Item>,
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.
impl TryExtend for ()
Available on crate feature
alloc only.type Item = ()
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.
impl TryExtend for String
Available on crate feature
alloc only.type Item = char
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.
impl<Item> TryExtend for LinkedList<Item>
Available on crate feature
alloc only.type Item = Item
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.
impl<Item> TryExtend for VecDeque<Item>
Available on crate feature
alloc only.type Item = Item
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.
impl<Item> TryExtend for Vec<Item>
Available on crate feature
alloc only.type Item = Item
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.
impl<Item, const N: usize> TryExtend for SmallVec<[Item; N]>
Available on crate feature
smallvec only.type Item = Item
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.
impl<Item: Eq + Hash, Seed: BuildHasher> TryExtend for HashSet<Item, Seed>
Available on crate feature
hashmap only.type Item = Item
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.
impl<Item: Ord> TryExtend for BinaryHeap<Item>
Available on crate feature
alloc only.type Item = Item
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.
impl<Item: Ord> TryExtend for BTreeSet<Item>
Available on crate feature
alloc only.type Item = Item
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.
impl<Key: Eq + Hash, Value, Seed: BuildHasher> TryExtend for HashMap<Key, Value, Seed>
Available on crate feature
hashmap only.type Item = (Key, Value)
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.
impl<Key: Ord, Value> TryExtend for BTreeMap<Key, Value>
Available on crate feature
alloc only.