pub struct SHashSet<T: StableType + AsFixedSizeBytes + Hash + Eq> { /* private fields */ }Expand description
Hashmap-based hashset
This is just a wrapper around SHashMap<T, ()>, read it’s documentation to get info on the internals.
Implementations§
Source§impl<T: StableType + AsFixedSizeBytes + Hash + Eq> SHashSet<T>
impl<T: StableType + AsFixedSizeBytes + Hash + Eq> SHashSet<T>
Sourcepub fn new() -> Self
pub fn new() -> Self
See SHashMap::new
Sourcepub fn new_with_capacity(capacity: usize) -> Result<Self, OutOfMemory>
pub fn new_with_capacity(capacity: usize) -> Result<Self, OutOfMemory>
Sourcepub fn insert(&mut self, value: T) -> Result<bool, T>
pub fn insert(&mut self, value: T) -> Result<bool, T>
See SHashMap::insert
Sourcepub fn remove<Q>(&mut self, value: &Q) -> bool
pub fn remove<Q>(&mut self, value: &Q) -> bool
See SHashMap::remove
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
See SHashMap::len
Sourcepub fn iter(&self) -> SHashSetIter<'_, T>
pub fn iter(&self) -> SHashSetIter<'_, T>
See SHashMap::iter
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
See SHashMap::clear
Trait Implementations§
Source§impl<T: StableType + AsFixedSizeBytes + Hash + Eq> AsFixedSizeBytes for SHashSet<T>
impl<T: StableType + AsFixedSizeBytes + Hash + Eq> AsFixedSizeBytes for SHashSet<T>
Source§type Buf = <SHashMap<T, ()> as AsFixedSizeBytes>::Buf
type Buf = <SHashMap<T, ()> as AsFixedSizeBytes>::Buf
Buffer that is used to encode this value into
Source§fn as_fixed_size_bytes(&self, buf: &mut [u8])
fn as_fixed_size_bytes(&self, buf: &mut [u8])
Encodes itself into a slice of bytes. Read more
Source§fn from_fixed_size_bytes(arr: &[u8]) -> Self
fn from_fixed_size_bytes(arr: &[u8]) -> Self
Decodes itself from a slice of bytes. Read more
Source§fn as_new_fixed_size_bytes(&self) -> Self::Buf
fn as_new_fixed_size_bytes(&self) -> Self::Buf
Encodes itself into a new Self::Buf of size == Self::SIZE
Source§impl<T: StableType + AsFixedSizeBytes + Hash + Eq + Debug> Debug for SHashSet<T>
impl<T: StableType + AsFixedSizeBytes + Hash + Eq + Debug> Debug for SHashSet<T>
Source§impl<T: StableType + AsFixedSizeBytes + Hash + Eq> Default for SHashSet<T>
impl<T: StableType + AsFixedSizeBytes + Hash + Eq> Default for SHashSet<T>
Source§impl<T: StableType + AsFixedSizeBytes + Hash + Eq> StableType for SHashSet<T>
impl<T: StableType + AsFixedSizeBytes + Hash + Eq> StableType for SHashSet<T>
Source§unsafe fn stable_drop_flag_off(&mut self)
unsafe fn stable_drop_flag_off(&mut self)
Sets stable drop flag to
off position, if it is applicable Read moreSource§unsafe fn stable_drop_flag_on(&mut self)
unsafe fn stable_drop_flag_on(&mut self)
Should set stable drop flag to
on position, if it is applicable Read moreSource§fn should_stable_drop(&self) -> bool
fn should_stable_drop(&self) -> bool
Should return the value of the stable drop flag
Source§unsafe fn stable_drop(&mut self)
unsafe fn stable_drop(&mut self)
Performs stable drop, releasing all underlying stable memory of this data structure Read more
Auto Trait Implementations§
impl<T> Freeze for SHashSet<T>
impl<T> RefUnwindSafe for SHashSet<T>where
T: RefUnwindSafe,
impl<T> Send for SHashSet<T>where
T: Send,
impl<T> Sync for SHashSet<T>where
T: Sync,
impl<T> Unpin for SHashSet<T>where
T: Unpin,
impl<T> UnwindSafe for SHashSet<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> AsDynSizeBytes for Twhere
T: AsFixedSizeBytes,
impl<T> AsDynSizeBytes for Twhere
T: AsFixedSizeBytes,
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