[][src]Struct abi_stable::type_layout::tagging::KeyValue

#[repr(C)]pub struct KeyValue<T> {
    pub key: T,
    pub value: T,
}

A key-value pair,used when constructing a map.

Fields

key: Tvalue: T

Implementations

impl<T> KeyValue<T>[src]

pub const fn new(key: T, value: T) -> Self[src]

Constructs a KeyValue with key,value

pub fn map<F, U>(self, f: F) -> KeyValue<U> where
    F: FnMut(T) -> U, 
[src]

Transforms the KeyValue<T> to KeyValue<U>, using f to convert T to U.

pub fn into_pair(self) -> (T, T)[src]

Converts the KeyValue into a (key, value) pair.

pub fn as_pair(&self) -> (&T, &T)[src]

Casts a &KeyValue into a (key, value) pair of references.

pub fn from_pair((key, value): (T, T)) -> Self[src]

Converts a (key, value) pair into a KeyValue.

Trait Implementations

impl<T: Clone> Clone for KeyValue<T>[src]

impl<T: Copy> Copy for KeyValue<T>[src]

impl<T: Debug> Debug for KeyValue<T>[src]

impl<T> Display for KeyValue<T> where
    T: Display + TagTrait, 
[src]

impl<T: Eq> Eq for KeyValue<T>[src]

impl<T> GetStaticEquivalent_ for KeyValue<T> where
    T: __StableAbi
[src]

type StaticEquivalent = _static_KeyValue<__GetStaticEquivalent<T>>

impl<T: Hash> Hash for KeyValue<T>[src]

impl<T: Ord> Ord for KeyValue<T>[src]

impl<T: PartialEq> PartialEq<KeyValue<T>> for KeyValue<T>[src]

impl<T: PartialOrd> PartialOrd<KeyValue<T>> for KeyValue<T>[src]

impl<T> StableAbi for KeyValue<T> where
    T: __StableAbi
[src]

type IsNonZeroType = False

Whether this type has a single invalid bit-pattern. Read more

impl<T> StructuralEq for KeyValue<T>[src]

impl<T> StructuralPartialEq for KeyValue<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for KeyValue<T> where
    T: RefUnwindSafe

impl<T> Send for KeyValue<T> where
    T: Send

impl<T> Sync for KeyValue<T> where
    T: Sync

impl<T> Unpin for KeyValue<T> where
    T: Unpin

impl<T> UnwindSafe for KeyValue<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> BorrowOwned<'a> for T where
    T: 'a + Clone
[src]

type ROwned = T

The owned type, stored in RCow::Owned

type RBorrowed = &'a T

The borrowed type, stored in RCow::Borrowed

impl<T> From<T> for T[src]

impl<T> GetWithMetadata for T[src]

type ForSelf = WithMetadata_<T, T>

This is always WithMetadata_<Self, Self>

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SelfOps for T where
    T: ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<This> TransmuteElement for This where
    This: ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The error type returned when the conversion fails.

impl<T> TypeIdentity for T where
    T: ?Sized
[src]

type Type = T

The same type as Self. Read more

impl<This> ValidTag_Bounds for This where
    This: Debug + Clone + PartialEq<This>, 
[src]