pub struct DetachableWeak<K, V> { /* private fields */ }
Expand description
A weak reference to an entry in a DetachableMap. This is a weak reference, if the entry is detached before it is upgraded, the entry can be gone.
Implementations§
Source§impl<K: Hash + Eq, V> DetachableWeak<K, V>
impl<K: Hash + Eq, V> DetachableWeak<K, V>
Sourcepub fn upgrade(&self) -> Option<Arc<V>>
pub fn upgrade(&self) -> Option<Arc<V>>
Attempt to upgrade the weak pointer to an Arc, extending the lifetime of the value if successful. Returns None if the item has been dropped (by another client detaching this)
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for DetachableWeak<K, V>where
K: Freeze,
impl<K, V> !RefUnwindSafe for DetachableWeak<K, V>
impl<K, V> Send for DetachableWeak<K, V>
impl<K, V> Sync for DetachableWeak<K, V>
impl<K, V> Unpin for DetachableWeak<K, V>where
K: Unpin,
impl<K, V> !UnwindSafe for DetachableWeak<K, V>
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
)