pub struct KeyValueRef<'a, Key, Value>{ /* private fields */ }Expand description
KeyValueRef contains DashMap’s Ref dashmap::mapref::one::Ref which internally holds
a RwLockReadGuard for the shard. It is returned as a response to get_ref method of crate::cache::cached::CacheD.
Any time get_ref method is invoked, the Store returns Option<KeyValueRef<'_, Key, StoredValue<Value>>>.
If the key is present in the Store, get_ref will return Some<KeyValueRef<'_, Key, StoredValue<Value>>>.
Hence, the invocation of get_ref will hold a lock against the shard that contains the key (within the scope of its usage).
Implementations§
Auto Trait Implementations§
impl<'a, Key, Value> Freeze for KeyValueRef<'a, Key, Value>
impl<'a, Key, Value> !RefUnwindSafe for KeyValueRef<'a, Key, Value>
impl<'a, Key, Value> Send for KeyValueRef<'a, Key, Value>
impl<'a, Key, Value> Sync for KeyValueRef<'a, Key, Value>
impl<'a, Key, Value> Unpin for KeyValueRef<'a, Key, Value>
impl<'a, Key, Value> !UnwindSafe for KeyValueRef<'a, Key, Value>
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