pub trait AsDedupVec {
type Item;
type Container;
// Required methods
fn new() -> Self;
fn len(&self) -> usize;
fn contains(&self, value: &Self::Item) -> bool;
fn push(&mut self, value: Self::Item);
fn remove(&mut self, value: &Self::Item) -> Option<Self::Item>;
fn extend(&mut self, iter: impl IntoIterator<Item = Self::Item>);
fn iter(&self) -> impl Iterator<Item = &Self::Item>;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
A trait for DedupVec.
This trait provides common interfaces for DedupVec.
Required Associated Types§
Required Methods§
Sourcefn contains(&self, value: &Self::Item) -> bool
fn contains(&self, value: &Self::Item) -> bool
Returns true if the vector contains the given value.
Sourcefn remove(&mut self, value: &Self::Item) -> Option<Self::Item>
fn remove(&mut self, value: &Self::Item) -> Option<Self::Item>
Removes an item that is equal to the given value from the vector.
Sourcefn extend(&mut self, iter: impl IntoIterator<Item = Self::Item>)
fn extend(&mut self, iter: impl IntoIterator<Item = Self::Item>)
Extends the vector with the given iterator.
Provided Methods§
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.