pub struct RefCountedHashSet<T> { /* private fields */ }
Expand description
A RefCountedHashMap
where the value is ()
.
Implementations§
source§impl<T: Eq + Hash> RefCountedHashSet<T>
impl<T: Eq + Hash> RefCountedHashSet<T>
sourcepub fn insert(&mut self, value: T) -> InsertResult<()>
pub fn insert(&mut self, value: T) -> InsertResult<()>
Increments the reference count of the given value.
sourcepub fn remove(&mut self, value: T) -> RemoveResult<()>
pub fn remove(&mut self, value: T) -> RemoveResult<()>
Decrements the reference count of the given value.
If the reference count reaches 0, the value will be removed from the set.
sourcepub fn iter_counts(&self) -> impl Iterator<Item = (&T, NonZeroUsize)> + '_
pub fn iter_counts(&self) -> impl Iterator<Item = (&T, NonZeroUsize)> + '_
Iterates over values and reference counts.
Trait Implementations§
source§impl<T: Debug> Debug for RefCountedHashSet<T>
impl<T: Debug> Debug for RefCountedHashSet<T>
source§impl<T> Default for RefCountedHashSet<T>
impl<T> Default for RefCountedHashSet<T>
source§fn default() -> RefCountedHashSet<T>
fn default() -> RefCountedHashSet<T>
Returns the “default value” for a type. Read more
source§impl<T: Eq + Hash> FromIterator<T> for RefCountedHashSet<T>
impl<T: Eq + Hash> FromIterator<T> for RefCountedHashSet<T>
source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl<T> Freeze for RefCountedHashSet<T>
impl<T> RefUnwindSafe for RefCountedHashSet<T>where
T: RefUnwindSafe,
impl<T> Send for RefCountedHashSet<T>where
T: Send,
impl<T> Sync for RefCountedHashSet<T>where
T: Sync,
impl<T> Unpin for RefCountedHashSet<T>where
T: Unpin,
impl<T> UnwindSafe for RefCountedHashSet<T>where
T: 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
source§impl<CC, BC, Meta> RecvFrameContext<BC, Meta> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
impl<CC, BC, Meta> RecvFrameContext<BC, Meta> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
source§impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
source§impl<Meta, BC> SendableFrameMeta<FakeFrameCtx<Meta>, BC> for Meta
impl<Meta, BC> SendableFrameMeta<FakeFrameCtx<Meta>, BC> for Meta
source§impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
Id: HandleableTimer<CC, BC>,
impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
Id: HandleableTimer<CC, BC>,
source§fn handle_timer(&mut self, bindings_ctx: &mut BC, id: Id)
fn handle_timer(&mut self, bindings_ctx: &mut BC, id: Id)
Handle a timer firing.