[][src]Trait refptr::Refcounted

pub unsafe trait Refcounted {
    type Rc: Refcount;
    unsafe fn refcount_metadata(&self) -> <Self::Rc as Refcount>::Metadata;
}

An invasively reference counted type.

Objects implementing this trait are always allocated on the heap, and have their lifecycle managed using the RefPtr smart pointer.

Safety

  • Refcounted objects are always heap-allocated
  • Only shared references may exist to Refcounted objects

Associated Types

type Rc: Refcount

Reference count used by this type.

Loading content...

Required methods

unsafe fn refcount_metadata(&self) -> <Self::Rc as Refcount>::Metadata

Metadata used internally by Refcount implementations.

This metadata can be used to implement dynamic extensions to the refcount type, such as finalize support or RTTI.

Loading content...

Implementors

Loading content...