pub struct Set<T: 'static> { /* private fields */ }
Expand description
An immutable set constructed at compile time.
Note
The fields of this struct are public so that they may be initialized by the
phf_set!
macro and code generation. They are subject to change at any
time and should never be accessed directly.
Implementations§
source§impl<T> Set<T>
impl<T> Set<T>
sourcepub fn get_key<U>(&self, key: &U) -> Option<&T>where
U: Eq + PhfHash + ?Sized,
T: PhfBorrow<U>,
pub fn get_key<U>(&self, key: &U) -> Option<&T>where U: Eq + PhfHash + ?Sized, T: PhfBorrow<U>,
Returns a reference to the set’s internal static instance of the given key.
This can be useful for interning schemes.
source§impl<T> Set<T>where
T: Eq + PhfHash + PhfBorrow<T>,
impl<T> Set<T>where T: Eq + PhfHash + PhfBorrow<T>,
sourcepub fn is_disjoint(&self, other: &Set<T>) -> bool
pub fn is_disjoint(&self, other: &Set<T>) -> bool
Returns true if other
shares no elements with self
.
sourcepub fn is_subset(&self, other: &Set<T>) -> bool
pub fn is_subset(&self, other: &Set<T>) -> bool
Returns true if other
contains all values in self
.
sourcepub fn is_superset(&self, other: &Set<T>) -> bool
pub fn is_superset(&self, other: &Set<T>) -> bool
Returns true if self
contains all values in other
.