[][src]Trait reference_counted::ReferenceCounted

pub trait ReferenceCounted<T: ?Sized>: IntoMut<T> + Clone {
    fn reference_count(this: &Self) -> usize;
}

A smart pointer that keeps track of how many pointers refer to the same allocation and exposes this information in its API.

Required methods

fn reference_count(this: &Self) -> usize

Get the number of owning pointers referring to the same allocation.

Implementations must fulfill that ReferenceCounted::reference_count(this) == 1 implies IntoMut::con_make_mut(this) == true.

Loading content...

Implementors

impl<T: ?Sized> ReferenceCounted<T> for Arc<T>[src]

impl<T: ?Sized> ReferenceCounted<T> for Rc<T>[src]

Loading content...