[][src]Struct cxx::SharedPtr

#[repr(C)]pub struct SharedPtr<T> where
    T: SharedPtrTarget, 
{ /* fields omitted */ }

BInding to C++ std::shared_ptr<T>.

Implementations

impl<T> SharedPtr<T> where
    T: SharedPtrTarget, 
[src]

pub fn null() -> Self[src]

Makes a new SharedPtr wrapping a null pointer.

Matches the behavior of default-constructing a std::shared_ptr.

pub fn new(value: T) -> Self where
    T: ExternType<Kind = Trivial>, 
[src]

Allocates memory on the heap and makes a SharedPtr owner for it.

pub fn is_null(&self) -> bool[src]

Chacks whether the SharedPtr does not own an object.

This is the opposite of std::shared_ptr<T>::operator bool.

pub fn as_ref(&self) -> Option<&T>[src]

Returns a reference to the object owned by this SharedPtr if any, otherwise None.

Trait Implementations

impl<T> Clone for SharedPtr<T> where
    T: SharedPtrTarget, 
[src]

impl<T> Debug for SharedPtr<T> where
    T: Debug + SharedPtrTarget, 
[src]

impl<T> Deref for SharedPtr<T> where
    T: SharedPtrTarget, 
[src]

type Target = T

The resulting type after dereferencing.

impl<T> Display for SharedPtr<T> where
    T: Display + SharedPtrTarget, 
[src]

impl<T> Drop for SharedPtr<T> where
    T: SharedPtrTarget, 
[src]

impl<T> Send for SharedPtr<T> where
    T: Send + Sync + SharedPtrTarget, 
[src]

impl<T> Sync for SharedPtr<T> where
    T: Send + Sync + SharedPtrTarget, 
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for SharedPtr<T> where
    T: RefUnwindSafe

impl<T> Unpin for SharedPtr<T> where
    T: Unpin

impl<T> UnwindSafe for SharedPtr<T> where
    T: UnwindSafe

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.