pub struct Item<K, V> { /* private fields */ }Implementations§
Source§impl<K, V> Item<K, V>
impl<K, V> Item<K, V>
pub fn new(key: K, value: V) -> Item<K, V>
pub fn key(&self) -> &K
Sourcepub fn key_mut(&mut self) -> &mut K
pub fn key_mut(&mut self) -> &mut K
Modifying a key in such a way that its order with regard to other keys changes is a logical error.
pub fn value(&self) -> &V
pub fn value_mut(&mut self) -> &mut V
Sourcepub fn set(&mut self, key: K, value: V) -> (K, V)
pub fn set(&mut self, key: K, value: V) -> (K, V)
Modifying a key in such a way that its order with regard to other keys changes is a logical error.
Sourcepub fn set_key(&mut self, key: K) -> K
pub fn set_key(&mut self, key: K) -> K
Modifying a key in such a way that its order with regard to other keys changes is a logical error.
pub fn set_value(&mut self, value: V) -> V
pub fn maybe_uninit_value_mut(&mut self) -> &mut MaybeUninit<V>
pub fn into_key(self) -> K
pub fn into_value(self) -> V
pub fn as_pair(&self) -> (&K, &V)
pub fn as_pair_mut(&mut self) -> (&mut K, &mut V)
pub fn into_pair(self) -> (K, V)
Sourcepub unsafe fn forget_value(self)
pub unsafe fn forget_value(self)
Drop the key but not the value which is assumed uninitialized.
§Safety
The value must be uninitialized.
pub fn into_inner(self) -> (MaybeUninit<K>, MaybeUninit<V>)
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for Item<K, V>
impl<K, V> RefUnwindSafe for Item<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Item<K, V>
impl<K, V> Sync for Item<K, V>
impl<K, V> Unpin for Item<K, V>
impl<K, V> UnwindSafe for Item<K, V>where
K: UnwindSafe,
V: UnwindSafe,
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