pub struct KeyValuePair<K, V> {
pub key: K,
pub value: V,
}Expand description
A key-value pair. When used as the element type of a SmallOrdSet, it
acts as a map.
Comparisons of this type only look at the key. This property also applies
to SmallOrdSet<KeyValuePair>.
Fields§
§key: KThe key, used for checking ordering and equality.
value: VThe value.
Trait Implementations§
Source§impl<K, V> Borrow<K> for KeyValuePair<K, V>
impl<K, V> Borrow<K> for KeyValuePair<K, V>
Source§impl<K: Clone, V: Clone> Clone for KeyValuePair<K, V>
impl<K: Clone, V: Clone> Clone for KeyValuePair<K, V>
Source§fn clone(&self) -> KeyValuePair<K, V>
fn clone(&self) -> KeyValuePair<K, V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<K: Default, V: Default> Default for KeyValuePair<K, V>
impl<K: Default, V: Default> Default for KeyValuePair<K, V>
Source§fn default() -> KeyValuePair<K, V>
fn default() -> KeyValuePair<K, V>
Returns the “default value” for a type. Read more
Source§impl<K: Hash, V> Hash for KeyValuePair<K, V>
impl<K: Hash, V> Hash for KeyValuePair<K, V>
Source§impl<K: Ord, V> Ord for KeyValuePair<K, V>
impl<K: Ord, V> Ord for KeyValuePair<K, V>
Source§impl<K: PartialEq, V> PartialEq for KeyValuePair<K, V>
impl<K: PartialEq, V> PartialEq for KeyValuePair<K, V>
Source§impl<K: PartialOrd, V> PartialOrd for KeyValuePair<K, V>
impl<K: PartialOrd, V> PartialOrd for KeyValuePair<K, V>
impl<K: Copy, V: Copy> Copy for KeyValuePair<K, V>
impl<K: Eq, V> Eq for KeyValuePair<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for KeyValuePair<K, V>
impl<K, V> RefUnwindSafe for KeyValuePair<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for KeyValuePair<K, V>
impl<K, V> Sync for KeyValuePair<K, V>
impl<K, V> Unpin for KeyValuePair<K, V>
impl<K, V> UnwindSafe for KeyValuePair<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