pub struct PinWeak<T: ?Sized>(/* private fields */);
Expand description
This is a safe wrapper around something that could be compared to Pin
<
Weak<T>
>
The typical way to obtain a PinWeak
is to call PinWeak::downgrade
Implementations§
Source§impl<T: ?Sized> PinWeak<T>
impl<T: ?Sized> PinWeak<T>
Sourcepub fn downgrade(rc: Pin<Rc<T>>) -> Self
pub fn downgrade(rc: Pin<Rc<T>>) -> Self
Equivalent function to Rc::downgrade
, but taking a Pin<Rc<T>>
instead.
Sourcepub fn upgrade(&self) -> Option<Pin<Rc<T>>>
pub fn upgrade(&self) -> Option<Pin<Rc<T>>>
Equivalent function to Weak::upgrade
, but taking a Pin<Rc<T>>
instead.
Sourcepub fn strong_count(&self) -> usize
pub fn strong_count(&self) -> usize
Equivalent to Weak::strong_count
Sourcepub fn weak_count(&self) -> usize
pub fn weak_count(&self) -> usize
Equivalent to Weak::weak_count
Sourcepub fn ptr_eq(&self, other: &Self) -> bool
pub fn ptr_eq(&self, other: &Self) -> bool
Equivalent to Weak::ptr_eq
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for PinWeak<T>where
T: ?Sized,
impl<T> !RefUnwindSafe for PinWeak<T>
impl<T> !Send for PinWeak<T>
impl<T> !Sync for PinWeak<T>
impl<T> Unpin for PinWeak<T>where
T: ?Sized,
impl<T> !UnwindSafe for PinWeak<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