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]
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]
T: SharedPtrTarget,
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> Clone for WeakPtr<T> where
T: WeakPtrTarget,
[src]fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Debug for WeakPtr<T> where
T: Debug + WeakPtrTarget + SharedPtrTarget,
[src]
impl<T> Debug for WeakPtr<T> where
T: Debug + WeakPtrTarget + SharedPtrTarget,
[src]Auto Trait Implementations
impl<T> RefUnwindSafe for WeakPtr<T> where
T: RefUnwindSafe,
impl<T> RefUnwindSafe for WeakPtr<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for WeakPtr<T> where
T: UnwindSafe,
impl<T> UnwindSafe for WeakPtr<T> where
T: UnwindSafe,