#[repr(C)]pub struct KVP<TKey, TValue> {
pub key: TKey,
pub value: TValue,
}Expand description
Represents the (key, value) pair, but with #[repr(C)] ABI.
Fields§
§key: TKey§value: TValueImplementations§
Source§impl<TKey, TValue> KVP<TKey, TValue>
impl<TKey, TValue> KVP<TKey, TValue>
Sourcepub const fn unpack(self) -> (TKey, TValue)
pub const fn unpack(self) -> (TKey, TValue)
Unpacks the KVP and returns the key and value as a tuple.
Sourcepub const unsafe fn unpack_ptr(ptr: *mut Self) -> (*mut TKey, *mut TValue)
pub const unsafe fn unpack_ptr(ptr: *mut Self) -> (*mut TKey, *mut TValue)
Sourcepub const fn as_ref_kvp(&self) -> KVP<&TKey, &TValue>
pub const fn as_ref_kvp(&self) -> KVP<&TKey, &TValue>
Sourcepub const fn as_mut_kvp(&mut self) -> KVP<&TKey, &mut TValue>
pub const fn as_mut_kvp(&mut self) -> KVP<&TKey, &mut TValue>
Sourcepub const fn as_tuple(&self) -> (&TKey, &TValue)
pub const fn as_tuple(&self) -> (&TKey, &TValue)
Returns references to the key and value as a tuple.
Sourcepub const fn as_mut_tuple(&mut self) -> (&mut TKey, &mut TValue)
pub const fn as_mut_tuple(&mut self) -> (&mut TKey, &mut TValue)
Returns mutable references to the key and value as a tuple.
Trait Implementations§
Source§impl<'de, TKey: Deserialize<'de>, TValue: Deserialize<'de>> Deserialize<'de> for KVP<TKey, TValue>
impl<'de, TKey: Deserialize<'de>, TValue: Deserialize<'de>> Deserialize<'de> for KVP<TKey, TValue>
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<TKey: Eq, TValue: Eq> Eq for KVP<TKey, TValue>
Source§impl<TKey, TValue> From<(TKey, TValue)> for KVP<TKey, TValue>
impl<TKey, TValue> From<(TKey, TValue)> for KVP<TKey, TValue>
Source§fn from((key, value): (TKey, TValue)) -> Self
fn from((key, value): (TKey, TValue)) -> Self
Converts to this type from the input type.
Source§impl<TKey, TValue> From<KVP<TKey, TValue>> for (TKey, TValue)
impl<TKey, TValue> From<KVP<TKey, TValue>> for (TKey, TValue)
Source§impl<TKey: PartialEq, TValue: PartialEq> PartialEq for KVP<TKey, TValue>
impl<TKey: PartialEq, TValue: PartialEq> PartialEq for KVP<TKey, TValue>
impl<TKey, TValue> StructuralPartialEq for KVP<TKey, TValue>
Auto Trait Implementations§
impl<TKey, TValue> Freeze for KVP<TKey, TValue>
impl<TKey, TValue> RefUnwindSafe for KVP<TKey, TValue>where
TKey: RefUnwindSafe,
TValue: RefUnwindSafe,
impl<TKey, TValue> Send for KVP<TKey, TValue>
impl<TKey, TValue> Sync for KVP<TKey, TValue>
impl<TKey, TValue> Unpin for KVP<TKey, TValue>
impl<TKey, TValue> UnsafeUnpin for KVP<TKey, TValue>where
TKey: UnsafeUnpin,
TValue: UnsafeUnpin,
impl<TKey, TValue> UnwindSafe for KVP<TKey, TValue>where
TKey: UnwindSafe,
TValue: 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