pub(crate) struct RefCount(pub(crate) NonNull<AtomicUsize>);
Expand description
Reference count object that is 1:1 with each reference.
All the clones of a given RefCount
point to the same
heap-allocated atomic reference count. When the count drops to
zero, only the count is freed. No other automatic cleanup takes
place; this is just a reference count, not a smart pointer.
RefCount
values are created only by LifeGuard::new
and by
Clone
, so every RefCount
is implicitly tied to some
LifeGuard
.
Tuple Fields§
§0: NonNull<AtomicUsize>
Implementations§
Trait Implementations§
impl Send for RefCount
impl Sync for RefCount
Auto Trait Implementations§
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