pub struct SingleKVMap<Key, Value> {
pub key: Key,
pub value: Value,
}Fields§
§key: Key§value: ValueImplementations§
Source§impl<Key, Value> SingleKVMap<Key, Value>
impl<Key, Value> SingleKVMap<Key, Value>
pub fn new(key: Key, value: Value) -> Self
pub fn from_entry(entry: (Key, Value)) -> Self
pub fn as_key(&self) -> &Key
pub fn as_key_mut(&mut self) -> &mut Key
pub fn into_key(self) -> Key
pub fn set_key(&mut self, new_key: Key) -> Key
pub fn as_value(&self) -> &Value
pub fn as_value_mut(&mut self) -> &mut Value
pub fn into_value(self) -> Value
pub fn set_value(&mut self, new_value: Value) -> Value
pub fn as_entry(&self) -> (&Key, &Value)
pub fn as_entry_mut(&mut self) -> (&mut Key, &mut Value)
pub fn into_entry(self) -> (Key, Value)
pub fn set_entry(&mut self, new_entry: (Key, Value)) -> (Key, Value)
Trait Implementations§
Source§impl<Key, Value> AsRef<SingleKVMap<Key, Value>> for SingleKVMap<Key, Value>
impl<Key, Value> AsRef<SingleKVMap<Key, Value>> for SingleKVMap<Key, Value>
Source§fn as_ref(&self) -> &SingleKVMap<Key, Value>
fn as_ref(&self) -> &SingleKVMap<Key, Value>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<Key: Clone, Value: Clone> Clone for SingleKVMap<Key, Value>
impl<Key: Clone, Value: Clone> Clone for SingleKVMap<Key, Value>
Source§fn clone(&self) -> SingleKVMap<Key, Value>
fn clone(&self) -> SingleKVMap<Key, Value>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<Key: Copy, Value: Copy> Copy for SingleKVMap<Key, Value>
Source§impl<'de, Key: Deserialize<'de>, Value: Deserialize<'de>> Deserialize<'de> for SingleKVMap<Key, Value>
impl<'de, Key: Deserialize<'de>, Value: Deserialize<'de>> Deserialize<'de> for SingleKVMap<Key, Value>
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl<Key: Eq, Value: Eq> Eq for SingleKVMap<Key, Value>
Source§impl<Key, Value> From<(Key, Value)> for SingleKVMap<Key, Value>
impl<Key, Value> From<(Key, Value)> for SingleKVMap<Key, Value>
Source§fn from(entry: (Key, Value)) -> Self
fn from(entry: (Key, Value)) -> Self
Converts to this type from the input type.
Source§impl<Key: JsonSchema, Value: JsonSchema> JsonSchema for SingleKVMap<Key, Value>
Available on crate feature schemars only.
impl<Key: JsonSchema, Value: JsonSchema> JsonSchema for SingleKVMap<Key, Value>
Available on crate feature
schemars only.Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl<Key: Ord, Value: Ord> Ord for SingleKVMap<Key, Value>
impl<Key: Ord, Value: Ord> Ord for SingleKVMap<Key, Value>
Source§fn cmp(&self, other: &SingleKVMap<Key, Value>) -> Ordering
fn cmp(&self, other: &SingleKVMap<Key, Value>) -> Ordering
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<LeftKey: PartialEq<RightKey>, LeftValue: PartialEq<RightValue>, RightKey, RightValue> PartialEq<SingleKVMap<RightKey, RightValue>> for SingleKVMap<LeftKey, LeftValue>
impl<LeftKey: PartialEq<RightKey>, LeftValue: PartialEq<RightValue>, RightKey, RightValue> PartialEq<SingleKVMap<RightKey, RightValue>> for SingleKVMap<LeftKey, LeftValue>
Source§fn eq(&self, other: &SingleKVMap<RightKey, RightValue>) -> bool
fn eq(&self, other: &SingleKVMap<RightKey, RightValue>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<Key: PartialOrd, Value: PartialOrd> PartialOrd for SingleKVMap<Key, Value>
impl<Key: PartialOrd, Value: PartialOrd> PartialOrd for SingleKVMap<Key, Value>
Auto Trait Implementations§
impl<Key, Value> Freeze for SingleKVMap<Key, Value>
impl<Key, Value> RefUnwindSafe for SingleKVMap<Key, Value>where
Key: RefUnwindSafe,
Value: RefUnwindSafe,
impl<Key, Value> Send for SingleKVMap<Key, Value>
impl<Key, Value> Sync for SingleKVMap<Key, Value>
impl<Key, Value> Unpin for SingleKVMap<Key, Value>
impl<Key, Value> UnsafeUnpin for SingleKVMap<Key, Value>where
Key: UnsafeUnpin,
Value: UnsafeUnpin,
impl<Key, Value> UnwindSafe for SingleKVMap<Key, Value>where
Key: UnwindSafe,
Value: 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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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§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.