KeyFor

Trait KeyFor 

Source
pub trait KeyFor {
    type Key;
    type Value;

    // Required method
    fn key_for(value: &Self::Value) -> Self::Key;
}
Expand description

Represents logic of providing key as specified (associated) type for given as specified (associated) type value by reference.

Required Associated Types§

Source

type Key

Generated key type.

Source

type Value

Value over which key should be generated type.

Required Methods§

Source

fn key_for(value: &Self::Value) -> Self::Key

Generates key for given by reference 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§