Trait KeyValuePair

Source
pub trait KeyValuePair {
    type Type: Debug + Copy + Clone + PartialEq + Eq + Hash;
    type Key: Debug + Clone + PartialEq + Eq + Hash;
    type Value: Debug + Clone + Default + PartialEq + Eq;
    type ValueRef<'l>: Debug + Copy + Clone + PartialEq + Eq + 'l
       where Self: 'l;
    type ValueRefMut<'l>: Debug + PartialEq + Eq + 'l
       where Self: 'l;

    // Required methods
    fn ty(&self) -> Self::Type;
    fn key(&self) -> Self::Key;
    fn value(&self) -> Self::Value;
    fn value_ref(&self) -> Self::ValueRef<'_>;
    fn value_mut(&mut self) -> Self::ValueRefMut<'_>;
    fn from_key_and_value(key: Self::Key, value: Self::Value) -> Self;
    fn from_key_and_value_ref(
        key: Self::Key,
        value_ref: Self::ValueRef<'_>,
    ) -> Self;
    fn into_key_and_value(self) -> (Self::Key, Self::Value);
}

Required Associated Types§

Source

type Type: Debug + Copy + Clone + PartialEq + Eq + Hash

Source

type Key: Debug + Clone + PartialEq + Eq + Hash

Source

type Value: Debug + Clone + Default + PartialEq + Eq

Source

type ValueRef<'l>: Debug + Copy + Clone + PartialEq + Eq + 'l where Self: 'l

Source

type ValueRefMut<'l>: Debug + PartialEq + Eq + 'l where Self: 'l

Required Methods§

Source

fn ty(&self) -> Self::Type

Source

fn key(&self) -> Self::Key

Source

fn value(&self) -> Self::Value

Source

fn value_ref(&self) -> Self::ValueRef<'_>

Source

fn value_mut(&mut self) -> Self::ValueRefMut<'_>

Source

fn from_key_and_value(key: Self::Key, value: Self::Value) -> Self

Source

fn from_key_and_value_ref(key: Self::Key, value_ref: Self::ValueRef<'_>) -> Self

Source

fn into_key_and_value(self) -> (Self::Key, Self::Value)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§