pub struct IterableSet<V> { /* private fields */ }Expand description
An iterable set backed by a map.
Implementations§
Source§impl<V: IterableMapHash + BorshSerialize + BorshDeserialize + Clone> IterableSet<V>
impl<V: IterableMapHash + BorshSerialize + BorshDeserialize + Clone> IterableSet<V>
Sourcepub fn new<S: Into<String>>(prefix: S) -> Self
pub fn new<S: Into<String>>(prefix: S) -> Self
Creates an empty IterableMap with the given prefix.
Sourcepub fn remove(&mut self, value: &V)
pub fn remove(&mut self, value: &V)
Removes a value from the set.
Has a worst-case runtime of O(n).
Sourcepub fn iter(&self) -> impl Iterator<Item = V> + '_
pub fn iter(&self) -> impl Iterator<Item = V> + '_
Creates an iterator visiting all the values in arbitrary order.
pub fn is_empty(&self) -> bool
Auto Trait Implementations§
impl<V> Freeze for IterableSet<V>
impl<V> RefUnwindSafe for IterableSet<V>where
V: RefUnwindSafe,
impl<V> Send for IterableSet<V>where
V: Send,
impl<V> Sync for IterableSet<V>where
V: Sync,
impl<V> Unpin for IterableSet<V>where
V: Unpin,
impl<V> UnsafeUnpin for IterableSet<V>
impl<V> UnwindSafe for IterableSet<V>where
V: 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