1
0
Fork
You've already forked enum-map
0
forked from sugar700/enum-map
A map with C-like enum keys represented internally as an array
  • Rust 100%
Find a file
2023年11月17日 09:17:45 +00:00
.reuse Update names in copyright notices 2023年11月08日 15:13:45 +01:00
.woodpecker Update names in copyright notices 2023年11月08日 15:13:45 +01:00
enum-map Release enum-map 2.7.2 2023年11月16日 17:24:12 +01:00
enum-map-derive Merge branch 'v2' into merge-v2-into-master-2 2023年11月17日 10:10:51 +01:00
LICENSES Comply with REUSE recommendations 2023年09月08日 08:39:16 +02:00
.gitignore Update names in copyright notices 2023年11月08日 15:13:45 +01:00
Cargo.lock Release enum-map 2.7.2 2023年11月16日 17:24:12 +01:00
Cargo.lock.license Update names in copyright notices 2023年11月08日 15:13:45 +01:00
Cargo.toml Update names in copyright notices 2023年11月08日 15:13:45 +01:00
CHANGELOG.md Merge branch 'v2' into merge-v2-into-master-2 2023年11月17日 10:10:51 +01:00
README.md Update names in copyright notices 2023年11月08日 15:13:45 +01:00
renovate.json Update Rust nightly version monthly 2023年09月25日 19:53:30 +02:00
renovate.json.license Update names in copyright notices 2023年11月08日 15:13:45 +01:00

enum-map

A library providing enum map providing type safe enum array. It is implemented using regular Rust arrays, so using them is as fast as using regular Rust arrays.

This crate follows the "N minus two" MSRV policy. This means that it supports the current Rust release, as well as the two before that.

Examples

#[macro_use]externcrateenum_map;useenum_map::EnumMap;#[derive(Debug, Enum)]enum Example{A,B,C,}fn main(){letmutmap=enum_map!{Example::A=>1,Example::B=>2,Example::C=>3,};map[Example::C]=4;assert_eq!(map[Example::A],1);for(key,&value)in&map{println!("{:?} has {} as value.",key,value);}}