[][src]Struct refptr::RefPtr

pub struct RefPtr<T: ?Sized + Refcounted> { /* fields omitted */ }

Strong reference to a Refcounted object.

Implementations

impl<T: ?Sized + Refcounted> RefPtr<T>[src]

pub fn new(val: &T) -> RefPtr<T>[src]

Obtain a strong reference to a Refcounted object.

pub unsafe fn from_raw(val: *const T) -> RefPtr<T>[src]

Recover a RefPtr from a raw pointer which was previously returned from into_raw. This does not increment the reference count.

pub fn into_raw(this: Self) -> *const T[src]

Acquire a raw pointer to the allocation, consuming the RefPtr.

Trait Implementations

impl<T: ?Sized + Refcounted> Clone for RefPtr<T>[src]

impl<T: ?Sized + Refcounted + Debug> Debug for RefPtr<T>[src]

impl<T: ?Sized + Refcounted> Deref for RefPtr<T>[src]

type Target = T

The resulting type after dereferencing.

impl<T: ?Sized + Refcounted + Display> Display for RefPtr<T>[src]

impl<T: ?Sized + Refcounted> Drop for RefPtr<T>[src]

impl<T: ?Sized + Refcounted + Eq> Eq for RefPtr<T>[src]

impl<'_, T: ?Sized + Refcounted> From<&'_ T> for RefPtr<T>[src]

impl<T: ?Sized + Refcounted + Hash> Hash for RefPtr<T>[src]

impl<T: ?Sized + Refcounted + Ord> Ord for RefPtr<T>[src]

impl<T: ?Sized + Refcounted + PartialEq> PartialEq<RefPtr<T>> for RefPtr<T>[src]

impl<T: ?Sized + Refcounted + PartialOrd> PartialOrd<RefPtr<T>> for RefPtr<T>[src]

impl<T: ?Sized + Refcounted> Pointer for RefPtr<T>[src]

impl<T: ?Sized + Refcounted + Sync + Send> Send for RefPtr<T>[src]

impl<T: ?Sized + Refcounted + Sync + Send> Sync for RefPtr<T>[src]

Auto Trait Implementations

impl<T: ?Sized> Unpin for RefPtr<T> where
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.