enum E {
A,
B,
C,
}
type EnumMap<Enum: Sized, Value: Default>
fn main() {
let mut map = EnumMap<E, f64>::default();
map[E::B] = 2.0;
assert_eq!(
map as Vec,
vec![
(E::A, 0.0),
(E::B, 2.0),
(E::C, 0.0),
]
);
}
does this hypothetical EnumMap type exist? or do i have to create it myself? and if i do have to create it myself, how to i do that?