pub struct Writeable<'a, K, V, S> { /* private fields */ }
Expand description
RAII structure used to release the exclusive write access, when dropped.
Implementations
sourceimpl<K: Eq + Hash, V, S: BuildHasher> Writeable<'_, K, V, S>
impl<K: Eq + Hash, V, S: BuildHasher> Writeable<'_, K, V, S>
sourcepub fn get_key_value(&self) -> Option<(&K, &V)>
pub fn get_key_value(&self) -> Option<(&K, &V)>
Returns the key-value pair corresponding to the supplied key.
sourcepub fn contains_key(&self) -> bool
pub fn contains_key(&self) -> bool
Returns true
if the map contains a value for the specified key.
sourcepub fn get_mut(&mut self) -> Option<&mut V>
pub fn get_mut(&mut self) -> Option<&mut V>
Returns a mutable reference to the value corresponding to the key.
sourcepub fn insert(self, value: V) -> Option<V>
pub fn insert(self, value: V) -> Option<V>
Inserts a key-value pair into the map.
If the map did not have this key present, None
is returned.
If the map did have this key present, the value is updated, and the old
value is returned. The key is not updated, though; this matters for
types that can be ==
without being identical.
sourcepub fn remove(&mut self) -> Option<V>
pub fn remove(&mut self) -> Option<V>
Removes a key from the map, returning the value at the key if the key was previously in the map.
sourcepub fn entry(&mut self) -> Entry<'_, K, V> where
K: Clone,
pub fn entry(&mut self) -> Entry<'_, K, V> where
K: Clone,
Gets the given key’s corresponding entry in the map for in-place manipulation.
sourcepub fn remove_entry(&mut self) -> Option<(K, V)>
pub fn remove_entry(&mut self) -> Option<(K, V)>
Removes a key from the map, returning the stored key and value if the key was previously in the map.
Trait Implementations
Auto Trait Implementations
impl<'a, K, V, S> RefUnwindSafe for Writeable<'a, K, V, S> where
K: RefUnwindSafe,
impl<'a, K, V, S> !Send for Writeable<'a, K, V, S>
impl<'a, K, V, S> Sync for Writeable<'a, K, V, S> where
K: Sync,
S: Sync,
V: Sync,
impl<'a, K, V, S> Unpin for Writeable<'a, K, V, S> where
K: Unpin,
impl<'a, K, V, S> UnwindSafe for Writeable<'a, K, V, S> where
K: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more