pub struct SBTreeSet<T: StableType + AsFixedSizeBytes + Ord> { /* private fields */ }Expand description
B-plus tree based set data structure
This is just a wrapper around SBTreeMap<T, ()>, read its documentation for more info on the internals
Implementations§
Source§impl<T: Ord + StableType + AsFixedSizeBytes> SBTreeSet<T>
impl<T: Ord + StableType + AsFixedSizeBytes> SBTreeSet<T>
Sourcepub fn new() -> Self
pub fn new() -> Self
See SBTreeMap::new
Sourcepub fn len(&self) -> u64
pub fn len(&self) -> u64
See SBTreeMap::len
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
See SBTreeMap::clear
Sourcepub fn get_random(&self, seed: u32) -> Option<SRef<'_, T>>
pub fn get_random(&self, seed: u32) -> Option<SRef<'_, T>>
Sourcepub fn iter(&self) -> SBTreeSetIter<'_, T>
pub fn iter(&self) -> SBTreeSetIter<'_, T>
See SBTreeMap::iter
Trait Implementations§
Source§impl<T: StableType + AsFixedSizeBytes + Ord> AsFixedSizeBytes for SBTreeSet<T>
impl<T: StableType + AsFixedSizeBytes + Ord> AsFixedSizeBytes for SBTreeSet<T>
Source§type Buf = <SBTreeMap<T, ()> as AsFixedSizeBytes>::Buf
type Buf = <SBTreeMap<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 + Ord + Debug> Debug for SBTreeSet<T>
impl<T: StableType + AsFixedSizeBytes + Ord + Debug> Debug for SBTreeSet<T>
Source§impl<T: Ord + StableType + AsFixedSizeBytes> Default for SBTreeSet<T>
impl<T: Ord + StableType + AsFixedSizeBytes> Default for SBTreeSet<T>
Source§impl<T: StableType + AsFixedSizeBytes + Ord> StableType for SBTreeSet<T>
impl<T: StableType + AsFixedSizeBytes + Ord> StableType for SBTreeSet<T>
Source§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§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§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 SBTreeSet<T>
impl<T> RefUnwindSafe for SBTreeSet<T>where
T: RefUnwindSafe,
impl<T> Send for SBTreeSet<T>where
T: Send,
impl<T> Sync for SBTreeSet<T>where
T: Sync,
impl<T> Unpin for SBTreeSet<T>where
T: Unpin,
impl<T> UnwindSafe for SBTreeSet<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