pub struct Entry<'a, K: Eq + Hash, V> { /* private fields */ }Expand description
An RAII guard providing exclusive access to a key-value pair in the LockMap.
The key is obtained directly from the internal State, so there is no need
for separate by-value / by-reference entry types.
When dropped, this type automatically unlocks the entry and may trigger cleanup of empty entries.
§Examples
use lockmap::LockMap;
let map = LockMap::new();
{
let mut entry = map.entry("key");
entry.insert(42);
}Implementations§
Trait Implementations§
impl<K: Eq + Hash + Send, V: Send> Send for Entry<'_, K, V>
impl<K: Eq + Hash + Send + Sync, V: Send + Sync> Sync for Entry<'_, K, V>
Auto Trait Implementations§
impl<'a, K, V> Freeze for Entry<'a, K, V>
impl<'a, K, V> !RefUnwindSafe for Entry<'a, K, V>
impl<'a, K, V> Unpin for Entry<'a, K, V>
impl<'a, K, V> UnsafeUnpin for Entry<'a, K, V>
impl<'a, K, V> !UnwindSafe for Entry<'a, 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