Struct lattices::collections::SingletonMap
source · pub struct SingletonMap<K, V>(pub K, pub V);
Expand description
A key-value entry wrapper representing a singleton map.
Tuple Fields§
§0: K
§1: V
Trait Implementations§
source§impl<K: Clone, V: Clone> Clone for SingletonMap<K, V>
impl<K: Clone, V: Clone> Clone for SingletonMap<K, V>
source§fn clone(&self) -> SingletonMap<K, V>
fn clone(&self) -> SingletonMap<K, V>
Returns a copy 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, V> Collection for SingletonMap<K, V>
impl<K, V> Collection for SingletonMap<K, V>
source§impl<K, V> CollectionMut for SingletonMap<K, V>
impl<K, V> CollectionMut for SingletonMap<K, V>
source§type ItemMut<'a> = &'a mut <SingletonMap<K, V> as Collection>::Item
where
Self: 'a
type ItemMut<'a> = &'a mut <SingletonMap<K, V> as Collection>::Item where Self: 'a
Type of mutable references to items of the collection.
source§fn upcast_item_mut<'short, 'long: 'short>(
r: Self::ItemMut<'long>,
) -> Self::ItemMut<'short>where
Self: 'long,
fn upcast_item_mut<'short, 'long: 'short>(
r: Self::ItemMut<'long>,
) -> Self::ItemMut<'short>where
Self: 'long,
Changes an item mutable reference into a shorter lived mutable reference. Read more
source§impl<K, V> CollectionRef for SingletonMap<K, V>
impl<K, V> CollectionRef for SingletonMap<K, V>
source§type ItemRef<'a> = &'a <SingletonMap<K, V> as Collection>::Item
where
Self: 'a
type ItemRef<'a> = &'a <SingletonMap<K, V> as Collection>::Item where Self: 'a
Type of references to items of the collection.
source§fn upcast_item_ref<'short, 'long: 'short>(
r: Self::ItemRef<'long>,
) -> Self::ItemRef<'short>where
Self: 'long,
fn upcast_item_ref<'short, 'long: 'short>(
r: Self::ItemRef<'long>,
) -> Self::ItemRef<'short>where
Self: 'long,
Changes an item reference into a shorter lived reference. Read more
source§impl<'de, K, V> Deserialize<'de> for SingletonMap<K, V>where
K: Deserialize<'de>,
V: Deserialize<'de>,
impl<'de, K, V> Deserialize<'de> for SingletonMap<K, V>where
K: Deserialize<'de>,
V: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<K, V> From<(K, V)> for SingletonMap<K, V>
impl<K, V> From<(K, V)> for SingletonMap<K, V>
source§impl<'a, Q, K, V> Get<&'a Q> for SingletonMap<K, V>
impl<'a, Q, K, V> Get<&'a Q> for SingletonMap<K, V>
source§impl<'a, Q, K, V> GetKeyValue<&'a Q> for SingletonMap<K, V>
impl<'a, Q, K, V> GetKeyValue<&'a Q> for SingletonMap<K, V>
source§fn get_key_value(
&self,
key: &'a Q,
) -> Option<(Self::KeyRef<'_>, Self::ItemRef<'_>)>
fn get_key_value( &self, key: &'a Q, ) -> Option<(Self::KeyRef<'_>, Self::ItemRef<'_>)>
Returns the key-value pair matching the given
key
.source§impl<'a, Q, K, V> GetKeyValueMut<&'a Q> for SingletonMap<K, V>
impl<'a, Q, K, V> GetKeyValueMut<&'a Q> for SingletonMap<K, V>
source§fn get_key_value_mut(
&mut self,
key: &'a Q,
) -> Option<(Self::KeyRef<'_>, Self::ItemMut<'_>)>
fn get_key_value_mut( &mut self, key: &'a Q, ) -> Option<(Self::KeyRef<'_>, Self::ItemMut<'_>)>
Returns the key-value pair matching the given
key
, with a mutable reference to the value.source§impl<'a, Q, K, V> GetMut<&'a Q> for SingletonMap<K, V>
impl<'a, Q, K, V> GetMut<&'a Q> for SingletonMap<K, V>
source§impl<K, V> IntoIterator for SingletonMap<K, V>
impl<K, V> IntoIterator for SingletonMap<K, V>
source§impl<K, V> Iter for SingletonMap<K, V>
impl<K, V> Iter for SingletonMap<K, V>
source§impl<K, V> Keyed for SingletonMap<K, V>
impl<K, V> Keyed for SingletonMap<K, V>
source§impl<K, V> KeyedRef for SingletonMap<K, V>
impl<K, V> KeyedRef for SingletonMap<K, V>
source§type KeyRef<'a> = &'a <SingletonMap<K, V> as Keyed>::Key
where
Self: 'a
type KeyRef<'a> = &'a <SingletonMap<K, V> as Keyed>::Key where Self: 'a
Type of references to keys of the collection.
source§fn upcast_key_ref<'short, 'long: 'short>(
r: Self::KeyRef<'long>,
) -> Self::KeyRef<'short>where
Self: 'long,
fn upcast_key_ref<'short, 'long: 'short>(
r: Self::KeyRef<'long>,
) -> Self::KeyRef<'short>where
Self: 'long,
Changes a key reference into a shorter lived reference. Read more
source§impl<K, V> Len for SingletonMap<K, V>
impl<K, V> Len for SingletonMap<K, V>
source§impl<K, V> MapIter for SingletonMap<K, V>
impl<K, V> MapIter for SingletonMap<K, V>
source§impl<K, V> MapIterMut for SingletonMap<K, V>
impl<K, V> MapIterMut for SingletonMap<K, V>
source§impl<K, OldVal> MapMapValues<OldVal> for SingletonMap<K, OldVal>
impl<K, OldVal> MapMapValues<OldVal> for SingletonMap<K, OldVal>
source§type MapValue<NewVal> = SingletonMap<K, NewVal>
type MapValue<NewVal> = SingletonMap<K, NewVal>
Output type, should be
Self
but with OldVal
replaced with NewVal
.source§fn map_values<NewVal, MapFn>(self, map_fn: MapFn) -> Self::MapValue<NewVal>where
MapFn: FnMut(OldVal) -> NewVal,
fn map_values<NewVal, MapFn>(self, map_fn: MapFn) -> Self::MapValue<NewVal>where
MapFn: FnMut(OldVal) -> NewVal,
Map the values into using the
map_fn
.source§impl<K: Ord, V: Ord> Ord for SingletonMap<K, V>
impl<K: Ord, V: Ord> Ord for SingletonMap<K, V>
source§fn cmp(&self, other: &SingletonMap<K, V>) -> Ordering
fn cmp(&self, other: &SingletonMap<K, V>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<K: PartialOrd, V: PartialOrd> PartialOrd for SingletonMap<K, V>
impl<K: PartialOrd, V: PartialOrd> PartialOrd for SingletonMap<K, V>
source§impl<K, V> Serialize for SingletonMap<K, V>
impl<K, V> Serialize for SingletonMap<K, V>
source§impl<K, V> SimpleCollectionRef for SingletonMap<K, V>
impl<K, V> SimpleCollectionRef for SingletonMap<K, V>
source§impl<K, V> SimpleKeyedRef for SingletonMap<K, V>
impl<K, V> SimpleKeyedRef for SingletonMap<K, V>
impl<K: Copy, V: Copy> Copy for SingletonMap<K, V>
impl<K: Eq, V: Eq> Eq for SingletonMap<K, V>
impl<K, V> StructuralPartialEq for SingletonMap<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for SingletonMap<K, V>
impl<K, V> RefUnwindSafe for SingletonMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for SingletonMap<K, V>
impl<K, V> Sync for SingletonMap<K, V>
impl<K, V> Unpin for SingletonMap<K, V>
impl<K, V> UnwindSafe for SingletonMap<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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more