pub struct AtomicRcData<T> { /* private fields */ }Expand description
Atomic reference-counted data with weak references for cycle prevention
Implementations§
Source§impl<T> AtomicRcData<T>
impl<T> AtomicRcData<T>
Sourcepub fn strong_count(&self) -> usize
pub fn strong_count(&self) -> usize
Get strong reference count
Sourcepub fn weak_count(&self) -> usize
pub fn weak_count(&self) -> usize
Get weak reference count
Sourcepub fn downgrade(&self) -> WeakRcData<T>
pub fn downgrade(&self) -> WeakRcData<T>
Create a weak reference to prevent cycles
Sourcepub fn try_unwrap(self) -> Result<T, Self>
pub fn try_unwrap(self) -> Result<T, Self>
Try to unwrap if this is the only reference
Trait Implementations§
Source§impl<T> Clone for AtomicRcData<T>
impl<T> Clone for AtomicRcData<T>
Source§impl<T: Debug> Debug for AtomicRcData<T>
impl<T: Debug> Debug for AtomicRcData<T>
Auto Trait Implementations§
impl<T> Freeze for AtomicRcData<T>
impl<T> RefUnwindSafe for AtomicRcData<T>where
T: RefUnwindSafe,
impl<T> Send for AtomicRcData<T>
impl<T> Sync for AtomicRcData<T>
impl<T> Unpin for AtomicRcData<T>
impl<T> UnwindSafe for AtomicRcData<T>where
T: RefUnwindSafe,
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more