Struct cxx::WeakPtr[][src]

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

Binding to C++ std::weak_ptr<T>.

The typical way to construct a WeakPtr from Rust is by downgrading from a SharedPtr.

Implementations

impl<T> WeakPtr<T> where
    T: WeakPtrTarget, 
[src]

pub fn null() -> Self[src]

Makes a new WeakPtr wrapping a null pointer.

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

pub fn upgrade(&self) -> SharedPtr<T> where
    T: SharedPtrTarget, 
[src]

Upgrades a non-owning reference into an owning reference if possible, otherwise to a null reference.

Matches the behavior of std::weak_ptr<T>::lock.

Trait Implementations

impl<T> Clone for WeakPtr<T> where
    T: WeakPtrTarget, 
[src]

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

impl<T> Drop for WeakPtr<T> where
    T: WeakPtrTarget, 
[src]

impl<T> Send for WeakPtr<T> where
    T: Send + Sync + WeakPtrTarget, 
[src]

impl<T> Sync for WeakPtr<T> where
    T: Send + Sync + WeakPtrTarget, 
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for WeakPtr<T> where
    T: RefUnwindSafe
[src]

impl<T> Unpin for WeakPtr<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for WeakPtr<T> where
    T: UnwindSafe
[src]

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, 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.