pub trait Collection {
type Item;
// Required methods
fn contains(&self, point: &Self::Item) -> bool;
fn is_empty(&self) -> bool;
}Expand description
A trait for collections that support basic set operations.
This trait defines fundamental operations applicable to various collection types, focusing on item containment and checking for emptiness.
§Type Parameters
Item: The type of elements contained within the collection.
§Implementations
Implementations are provided for:
HashSet<T, S>: WhereT: Hash + Eq + CloneandS: BuildHasher + Default.BTreeSet<T>: WhereT: Ord + Clone.Vec<T>: WhereT: PartialEq.
Required Associated Types§
Required Methods§
Implementations on Foreign Types§
Source§impl<T: PartialEq> Collection for Vec<T>
impl<T: PartialEq> Collection for Vec<T>
Source§impl<T: Hash + Eq + Clone, S: BuildHasher + Default> Collection for HashSet<T, S>
impl<T: Hash + Eq + Clone, S: BuildHasher + Default> Collection for HashSet<T, S>
Implementors§
Source§impl<T: ComplexElement> Collection for Complex<T>
Implementation of Collection for complexes.
impl<T: ComplexElement> Collection for Complex<T>
Implementation of Collection for complexes.
Provides basic set-theoretic operations for checking element membership and complex emptiness. Note that containment is based on ID equality, so elements must have been added to the complex to be considered contained.