Struct cxx::WeakPtr [−][src]
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]
T: WeakPtrTarget,
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]
T: WeakPtrTarget,
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]
T: Debug + WeakPtrTarget + SharedPtrTarget,
impl<T> Drop for WeakPtr<T> where
T: WeakPtrTarget,
[src]
T: WeakPtrTarget,
impl<T> Send for WeakPtr<T> where
T: Send + Sync + WeakPtrTarget,
[src]
T: Send + Sync + WeakPtrTarget,
impl<T> Sync for WeakPtr<T> where
T: Send + Sync + WeakPtrTarget,
[src]
T: Send + Sync + WeakPtrTarget,
Auto Trait Implementations
impl<T> RefUnwindSafe for WeakPtr<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Unpin for WeakPtr<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for WeakPtr<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,