pub struct LazyEntry<K, V> { /* private fields */ }
Implementations§
Source§impl<K: Hash + Eq + Clone, V> LazyEntry<K, V>
impl<K: Hash + Eq + Clone, V> LazyEntry<K, V>
Sourcepub fn try_insert(&self, value: V) -> Result<DetachableWeak<K, V>, V>
pub fn try_insert(&self, value: V) -> Result<DetachableWeak<K, V>, V>
Attempt to insert into the map at key
. Returns a detachable weak entry if the value was
inserted, and Err(value) if the item already existed.
Err(value) if the value was not able to be inserted.
Sourcepub fn get(&self) -> Option<DetachableWeak<K, V>>
pub fn get(&self) -> Option<DetachableWeak<K, V>>
Attempt to resolve the entry to a weak reference, as returned by DetachableMap::get
.
Returns None if the key does not exist.
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for LazyEntry<K, V>where
K: Freeze,
impl<K, V> !RefUnwindSafe for LazyEntry<K, V>
impl<K, V> Send for LazyEntry<K, V>
impl<K, V> Sync for LazyEntry<K, V>
impl<K, V> Unpin for LazyEntry<K, V>where
K: Unpin,
impl<K, V> !UnwindSafe for LazyEntry<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
)