pub trait MapValue: Sized { type Key; type Map; // Required methods fn to_key(&self) -> Self::Key; fn make_map() -> Self::Map; }
Implement this trait on your enum to bind a Map and Key type to it
Associated Key type (most likely an enum of unit variants)
Map allowing 1-to-1 mapping between Keys and Value (Self)
Match each enum variant to a Key
Initialize an empty Map