pub trait MapValue: Sized {
    type Key;
    type Map;

    // Required methods
    fn to_key(&self) -> Self::Key;
    fn make_map() -> Self::Map;
}
Expand description

Implement this trait on your enum to bind a Map and Key type to it

Required Associated Types§

source

type Key

Associated Key type (most likely an enum of unit variants)

source

type Map

Map allowing 1-to-1 mapping between Keys and Value (Self)

Required Methods§

source

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

Match each enum variant to a Key

source

fn make_map() -> Self::Map

Initialize an empty Map

Implementors§