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
2024年03月22日 19:26:44 +00:00
.reuse Update names in copyright notices 2023年11月08日 15:13:45 +01:00
enum-map Downgrade Cargo.lock dependencies to match Cargo.toml dependencies 2023年12月06日 09:25:34 +01:00
enum-map-derive Update proc macro crates to newest versions 2024年01月02日 11:55:30 +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
.woodpecker.yml Update rust Docker tag to v1.77.0 2024年03月22日 01:21:48 +00:00
Cargo.lock Update proc macro crates to newest versions 2024年01月02日 11:55:30 +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 Add optional support for borsh serialisation 2023年12月01日 08:32:46 +09:00
README.md Update names in copyright notices 2023年11月08日 15:13:45 +01:00
renovate.json Fix major and minor version matching in Renovate for MSRV Rust 2023年12月23日 17:10:12 +01: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);}}