[][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

Methods

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.

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

Converts the KeyValue into a pair.

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

Casts a &KeyValue into a pair of references.

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

Converts a pair into a KeyValue.

Trait Implementations

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

type StaticEquivalent = _static_KeyValue<__GetStaticEquivalent<T>>

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

type IsNonZeroType = False

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

type Kind = __ValueKind

The kind of abi stability of this type,there are 2: Read more

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

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

impl<T: Eq> Eq 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> Display for KeyValue<T> where
    T: Display + TagTrait, 
[src]

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

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

Auto Trait Implementations

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

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

Blanket Implementations

impl<This> GetConstGenericVTable for This where
    This: StableAbi + Eq + PartialEq<This> + Debug + Send + Sync
[src]

impl<This> StableAbi for This where
    This: SharedStableAbi<Kind = ValueKind>, 
[src]

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

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

type ROwned = T

type RBorrowed = &'a T

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

impl<T> From<T> for T[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<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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

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

type Type = T

The same type as Self. Read more

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

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.