pub trait KeySet<T, K> {
Show 17 methods
// Required methods
fn new(get_key: GetKeyType<T, K>) -> Self;
fn from_intoiter(
get_key: GetKeyType<T, K>,
iter: impl IntoIterator<Item = T>,
) -> Self;
fn insert(&mut self, value: T);
fn contains(&self, value: &T) -> bool;
fn remove(&mut self, value: &T) -> bool;
fn take(&mut self, value: &T) -> Option<T>;
fn get(&mut self, value: &T) -> Option<&T>;
fn len(&self) -> usize;
fn iter(&self) -> IntoIter<&T>;
fn intersection<'a>(&'a self, other: &'a Self) -> Self;
fn union<'a>(&'a self, other: &'a Self) -> Self;
fn difference<'a>(&'a self, other: &'a Self) -> Self;
fn symmetric_difference<'a>(&'a self, other: &'a Self) -> Self;
// Provided methods
fn is_subset(&self, other: &Self) -> bool { ... }
fn is_superset(&self, other: &Self) -> bool { ... }
fn is_empty(&self) -> bool { ... }
fn is_disjoint(&self, other: &Self) -> bool { ... }
}
Expand description
KeySet
Required Methods§
Sourcefn new(get_key: GetKeyType<T, K>) -> Self
fn new(get_key: GetKeyType<T, K>) -> Self
Create KeySet
fn from_intoiter( get_key: GetKeyType<T, K>, iter: impl IntoIterator<Item = T>, ) -> Self
fn contains(&self, value: &T) -> bool
fn remove(&mut self, value: &T) -> bool
fn take(&mut self, value: &T) -> Option<T>
fn get(&mut self, value: &T) -> Option<&T>
fn len(&self) -> usize
fn iter(&self) -> IntoIter<&T>
Sourcefn intersection<'a>(&'a self, other: &'a Self) -> Self
fn intersection<'a>(&'a self, other: &'a Self) -> Self
Operate with other KeySet
fn union<'a>(&'a self, other: &'a Self) -> Self
fn difference<'a>(&'a self, other: &'a Self) -> Self
fn symmetric_difference<'a>(&'a self, other: &'a Self) -> Self
Provided Methods§
fn is_superset(&self, other: &Self) -> bool
fn is_empty(&self) -> bool
fn is_disjoint(&self, other: &Self) -> bool
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.