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<O, BC> BuildableCoreContext<BC> for Owhere
O: Default,
impl<O, BC> BuildableCoreContext<BC> for Owhere
O: Default,
Source§impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
impl<CC, BC, Meta> RecvFrameContext<Meta, BC> 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§fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
Send a frame. Read more
Source§impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
Source§fn handle_timer(
&mut self,
bindings_ctx: &mut BC,
dispatch: Id,
timer: <BC as TimerBindingsTypes>::UniqueTimerId,
)
fn handle_timer( &mut self, bindings_ctx: &mut BC, dispatch: Id, timer: <BC as TimerBindingsTypes>::UniqueTimerId, )
Handle a timer firing. Read more