Trait identity_core::common::KeyComparable

source ·
pub trait KeyComparable {
    type Key: PartialEq + ?Sized;

    // Required method
    fn key(&self) -> &Self::Key;
}
Expand description

A trait for comparing types only by a certain key.

Required Associated Types§

source

type Key: PartialEq + ?Sized

Key type for comparisons.

Required Methods§

source

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

Returns a reference to the key.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl KeyComparable for &str

§

type Key = str

source§

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

source§

impl KeyComparable for bool

§

type Key = bool

source§

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

source§

impl KeyComparable for char

§

type Key = char

source§

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

source§

impl KeyComparable for f32

§

type Key = f32

source§

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

source§

impl KeyComparable for f64

§

type Key = f64

source§

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

source§

impl KeyComparable for i8

§

type Key = i8

source§

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

source§

impl KeyComparable for i16

§

type Key = i16

source§

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

source§

impl KeyComparable for i32

§

type Key = i32

source§

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

source§

impl KeyComparable for i64

§

type Key = i64

source§

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

source§

impl KeyComparable for i128

§

type Key = i128

source§

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

source§

impl KeyComparable for isize

§

type Key = isize

source§

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

source§

impl KeyComparable for str

§

type Key = str

source§

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

source§

impl KeyComparable for u8

§

type Key = u8

source§

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

source§

impl KeyComparable for u16

§

type Key = u16

source§

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

source§

impl KeyComparable for u32

§

type Key = u32

source§

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

source§

impl KeyComparable for u64

§

type Key = u64

source§

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

source§

impl KeyComparable for u128

§

type Key = u128

source§

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

source§

impl KeyComparable for usize

§

type Key = usize

source§

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

source§

impl KeyComparable for String

§

type Key = str

source§

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

Implementors§