pub struct Set<H> { /* private fields */ }
Expand description
A mutable, perfectly-hashed set. Note that a small domain is recommended.
For sparse sets, you might prefer std::collections::HashSet
.
Implementations§
source§impl<H: PerfectHash> Set<H>
impl<H: PerfectHash> Set<H>
sourcepub fn insert(&mut self, k: H::K) -> bool
pub fn insert(&mut self, k: H::K) -> bool
Insert a key into the set, so that contains
for an equal key returns true
in the future.
Returns whether this key already was in the set.
sourcepub fn erase(&mut self, k: H::K) -> bool
pub fn erase(&mut self, k: H::K) -> bool
Erases a key from the set, so that contains
for an equal key returns false
in the future.
Returns whether this key already was in the set.
pub fn is_empty(&self) -> bool
pub fn is_full(&self) -> bool
Trait Implementations§
source§impl<'a, H: HashInverse> IntoIterator for &'a Set<H>
impl<'a, H: HashInverse> IntoIterator for &'a Set<H>
Auto Trait Implementations§
impl<H> RefUnwindSafe for Set<H>where H: RefUnwindSafe,
impl<H> Send for Set<H>where H: Send,
impl<H> Sync for Set<H>where H: Sync,
impl<H> Unpin for Set<H>where H: Unpin,
impl<H> UnwindSafe for Set<H>where H: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more