[−][src]Trait refptr::refcnt::Refcount
A reference count
Associated Types
type Metadata
Metadata type which can be obtained from the underlying Refcounted
object.
Required methods
unsafe fn new() -> Self
Construct a new instance of the refcount, initialized to a default value.
unsafe fn inc_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
T: Refcounted<Rc = Self>,
Increment the strong reference count for this object.
Prefer managing the lifecycle of Refcounted
objects with RefPtr
over manually calling these methods.
This must only be called while the strong reference count is at least 1.
If only weak references only exist for this object, the upgrade
method
must be used instead.
unsafe fn dec_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
T: Refcounted<Rc = Self>,
Decrement the strong reference count for this object.
Prefer managing the lifecycle of Refcounted
objects with RefPtr
over manually calling these methods.
unsafe fn strong_count<T: ?Sized>(ptr: *const Inner<T>) -> usize where
T: Refcounted<Rc = Self>,
T: Refcounted<Rc = Self>,
Gets the number of strong references to this allocation.
Implementors
impl Refcount for Atomic
[src]
type Metadata = ()
unsafe fn new() -> Self
[src]
unsafe fn inc_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
unsafe fn dec_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
unsafe fn strong_count<T: ?Sized>(ptr: *const Inner<T>) -> usize where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
impl Refcount for AtomicFinalize
[src]
type Metadata = unsafe fn(_: *const u8)
unsafe fn new() -> Self
[src]
unsafe fn inc_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
unsafe fn dec_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
unsafe fn strong_count<T: ?Sized>(ptr: *const Inner<T>) -> usize where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
impl Refcount for AtomicWeak
[src]
type Metadata = ()
unsafe fn new() -> Self
[src]
unsafe fn inc_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
unsafe fn dec_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
unsafe fn strong_count<T: ?Sized>(ptr: *const Inner<T>) -> usize where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
impl Refcount for AtomicWeakFinalize
[src]
type Metadata = unsafe fn(_: *const u8)
unsafe fn new() -> Self
[src]
unsafe fn inc_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
unsafe fn dec_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
unsafe fn strong_count<T: ?Sized>(ptr: *const Inner<T>) -> usize where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
impl Refcount for Local
[src]
type Metadata = ()
unsafe fn new() -> Self
[src]
unsafe fn inc_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
unsafe fn dec_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
unsafe fn strong_count<T: ?Sized>(ptr: *const Inner<T>) -> usize where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
impl Refcount for LocalFinalize
[src]
type Metadata = unsafe fn(_: *const u8)
unsafe fn new() -> Self
[src]
unsafe fn inc_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
unsafe fn dec_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
unsafe fn strong_count<T: ?Sized>(ptr: *const Inner<T>) -> usize where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
impl Refcount for LocalWeak
[src]
type Metadata = ()
unsafe fn new() -> Self
[src]
unsafe fn inc_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
unsafe fn dec_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
unsafe fn strong_count<T: ?Sized>(ptr: *const Inner<T>) -> usize where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
impl Refcount for LocalWeakFinalize
[src]
type Metadata = unsafe fn(_: *const u8)
unsafe fn new() -> Self
[src]
unsafe fn inc_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
unsafe fn dec_strong<T: ?Sized>(ptr: *const Inner<T>) where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,
unsafe fn strong_count<T: ?Sized>(ptr: *const Inner<T>) -> usize where
T: Refcounted<Rc = Self>,
[src]
T: Refcounted<Rc = Self>,