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§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more