#[repr(C)]pub struct WeakPtr<T> where
T: WeakPtrTarget, { /* private fields */ }
Expand description
Binding to C++ std::weak_ptr<T>
.
The typical way to construct a WeakPtr from Rust is by downgrading from a SharedPtr.
Implementations
Makes a new WeakPtr wrapping a null pointer.
Matches the behavior of default-constructing a std::weak_ptr.
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
Auto Trait Implementations
impl<T> RefUnwindSafe for WeakPtr<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for WeakPtr<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more