pub unsafe trait RefCounted: Clone + Sized + 'static {
    type InnerType;

    // Required methods
    unsafe fn ref_(this: *const Self::InnerType) -> *const Self::InnerType;
    unsafe fn as_ptr(&self) -> *const Self::InnerType;
    unsafe fn into_raw(self) -> *const Self::InnerType;
    unsafe fn from_raw(this: *const Self::InnerType) -> Self;
}

Required Associated Types§

source

type InnerType

The inner type

Required Methods§

source

unsafe fn ref_(this: *const Self::InnerType) -> *const Self::InnerType

The function used to increment the inner type refcount

source

unsafe fn as_ptr(&self) -> *const Self::InnerType

Provides access to a raw pointer to InnerType

source

unsafe fn into_raw(self) -> *const Self::InnerType

Converts the RefCounted object to a raw pointer to InnerType

source

unsafe fn from_raw(this: *const Self::InnerType) -> Self

Converts a raw pointer to InnerType to a RefCounted object

Implementations on Foreign Types§

source§

impl<T> RefCounted for Rc<T>where T: 'static,

§

type InnerType = T

source§

unsafe fn ref_(this: *const Self::InnerType) -> *const Self::InnerType

source§

unsafe fn as_ptr(&self) -> *const Self::InnerType

source§

unsafe fn into_raw(self) -> *const Self::InnerType

source§

unsafe fn from_raw(this: *const Self::InnerType) -> Self

source§

impl<T> RefCounted for Arc<T>where T: 'static,

§

type InnerType = T

source§

unsafe fn ref_(this: *const Self::InnerType) -> *const Self::InnerType

source§

unsafe fn as_ptr(&self) -> *const Self::InnerType

source§

unsafe fn into_raw(self) -> *const Self::InnerType

source§

unsafe fn from_raw(this: *const Self::InnerType) -> Self

Implementors§