pub struct Entry<K, V>(pub K, pub V);Expand description
Entry(key, value) is a single-entry map for the serde formats.
let json = r#"{"foo":42}"#;
let entry = Entry("foo".to_owned(), 42);
assert_eq!(json, serde_json::to_string(&entry).unwrap());
assert_eq!(entry, serde_json::from_str(json).unwrap());Tuple Fields§
§0: K§1: VTrait Implementations§
impl<K: Copy, V: Copy> Copy for Entry<K, V>
Source§impl<'de, K: Deserialize<'de>, V: Deserialize<'de>> Deserialize<'de> for Entry<K, V>
impl<'de, K: Deserialize<'de>, V: Deserialize<'de>> Deserialize<'de> for Entry<K, V>
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
impl<K: Eq, V: Eq> Eq for Entry<K, V>
Source§impl<K: Ord, V: Ord> Ord for Entry<K, V>
impl<K: Ord, V: Ord> Ord for Entry<K, V>
1.21.0 (const: unstable) · 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 Entry<K, V>
impl<K: PartialOrd, V: PartialOrd> PartialOrd for Entry<K, V>
impl<K: PartialEq, V: PartialEq> StructuralPartialEq for Entry<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for Entry<K, V>
impl<K, V> RefUnwindSafe for Entry<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Entry<K, V>
impl<K, V> Sync for Entry<K, V>
impl<K, V> Unpin for Entry<K, V>
impl<K, V> UnsafeUnpin for Entry<K, V>where
K: UnsafeUnpin,
V: UnsafeUnpin,
impl<K, V> UnwindSafe for Entry<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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.