pub struct Weak<T: ?Sized + Trace + 'static> { /* private fields */ }
Available on crate feature
weak-ptrs
only.Expand description
A non-owning pointer to the managed allocation.
Implementations§
Source§impl<T: ?Sized + Trace> Weak<T>
impl<T: ?Sized + Trace> Weak<T>
Sourcepub fn ptr_eq(this: &Weak<T>, other: &Weak<T>) -> bool
pub fn ptr_eq(this: &Weak<T>, other: &Weak<T>) -> bool
Returns true
if the two Weak
s point to the same allocation, or if both don’t point to any allocation
(because they were created with Weak::new()
). This function ignores the metadata of dyn Trait
pointers.
Sourcepub fn strong_count(&self) -> u32
pub fn strong_count(&self) -> u32
Sourcepub fn weak_count(&self) -> u32
pub fn weak_count(&self) -> u32
Trait Implementations§
Source§impl<T: ?Sized + Trace> Clone for Weak<T>
impl<T: ?Sized + Trace> Clone for Weak<T>
impl<T, U> CoerceUnsized<Weak<U>> for Weak<T>
Available on crate feature
nightly
only.Auto Trait Implementations§
impl<T> Freeze for Weak<T>where
T: ?Sized,
impl<T> !RefUnwindSafe for Weak<T>
impl<T> !Send for Weak<T>
impl<T> !Sync for Weak<T>
impl<T> Unpin for Weak<T>where
T: ?Sized,
impl<T> !UnwindSafe for Weak<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)