pub struct RefCounted { /* private fields */ }Expand description
Support for intrusive atomic reference counting.
This supports intrusive atomic reference counting with adoption. This means
that a new object starts life at a reference count of 1 and has to be adopted
by a type (such as a fbl::RefPtr) that begins manipulation of the reference
count. If the reference count ever reaches zero, the object’s lifetime is
over and it should be destroyed (Release() returns true if this is the case).
Implementations§
Source§impl RefCounted
impl RefCounted
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Create a new RefCounted.
In debug builds, the initial count is set to a sentinel value to detect use before adoption. In release builds, it starts at 1.
Sourcepub fn ref_count_debug(&self) -> i32
pub fn ref_count_debug(&self) -> i32
Current ref count. Only to be used for debugging purposes.
Auto Trait Implementations§
impl !Freeze for RefCounted
impl RefUnwindSafe for RefCounted
impl Send for RefCounted
impl Sync for RefCounted
impl Unpin for RefCounted
impl UnsafeUnpin for RefCounted
impl UnwindSafe for RefCounted
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> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
Initializes
slot. Read more