NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #1294 most downloaded on crates.io
A map with C-like enum keys represented internally as an array
Last release 2 months ago
21 Jul 2026
Ships unpredictably
gaps range from 8 days to 2.7 years
Some releases are documented
notes for 30 of the last 60 stable releases
8 versions withdrawn
withdrawn after publishing
9 years old
82 releases · first in 2017
Exposed Array trait, to make accessing Enum 's length easier.
Array trait, to make accessing Enum's length easier.Fixed a soundness bug allowing manually created enum implementations with a type mismatch for their Array type. Previously code like this compiled and crashed when executed.
impl Enum for IntentionallyWrong {
type Array<V> = [String; 4];
fn from_usize(_: usize) -> Self {
IntentionallyWrong
}
fn into_usize(self) -> usize {
0
}
}
enum_map! { IntentionallyWrong => 42 };
Now this is rejected by the compiler.
One column per quarter.
Array trait, to make accessing Enum's length easier.Fixed a soundness bug allowing manually created enum implementations with
a type mismatch for their Array type. Previously code like this compiled
and crashed when executed.
struct IntentionallyWrong;
impl Enum for IntentionallyWrong {
type Array<V> = [String; 4];
fn from_usize(_: usize) -> Self {
IntentionallyWrong
}
fn into_usize(self) -> usize {
0
}
}
enum_map! { IntentionallyWrong => 42 };
Now this is rejected by the compiler.
Implemented EnumMap::try_from_fn and EnumMap::try_map .
EnumMap::try_from_fn and EnumMap::try_map.bytemuck feature, allowing using EnumMap with bytemuck crate.## Other changes - Updated author name.
derive feature is now an optional default feature.
EnumMap::from_fn.derive feature is now an optional default feature.Enum and EnumArray traits are now combined into a single trait using generic associated types. Trait bounds talking about EnumArray (like K: EnumArray
Enum and EnumArray traits are now combined into a single trait
using generic associated types. Trait bounds talking about
EnumArray (like K: EnumArray<V>) must be replaced with K: Enum.Fixed a regression introduced in 2.7.2 that caused #[derive(Enum)] to generate incorrect code when dealing with enums containing fields .
Reduced RAM usage and improved compilation times when using derive(Enum) for large enums with overflow-checks enabled.
derive(Enum)overflow-checks enabled.Other changes Updated author name.
New features Implemented EnumMap::from_fn .
EnumMap::from_fn.Updated the repository URL as the project was migrated from GitHub to Codeberg.
Updated the repository URL as the project was migrated from GitHub to Codeberg.
This project is now compliant with the REUSE Specification.
Hide out_of_bounds reexport from documentation.
out_of_bounds reexport from documentation.Provide better panic message when providing out-of-bounds index to Enum::from_usize`.
EnumMap::as_array is now usable in const contexts.
EnumMap::as_array is now usable in const contexts.This crate now follows "N minus two" MSRV policy. This means that it supports the current Rust release, as well as the two before that.
Upgraded syn to 2.0.0.
Implemented EnumMap::as_array and EnumMap::as_mut_array (implemented by @Fuuzetsu ).
EnumMap::as_array and EnumMap::as_mut_array (implemented by @Fuuzetsu).PartialOrd and Ord for EnumMap (implemented by @nicarran).Full Changelog: https://github.com/xfix/enum-map/compare/v2.4.2...v2.5.0
Added license files to crate tarball.
Full Changelog: https://github.com/xfix/enum-map/compare/v2.4.1...v2.4.2
Improved performance of code generated for from_usize when deriving Enum . Fixes #23 .
from_usize when deriving Enum. Fixes #23.Implemented Enum for () (unit type) and core::Ordering (implemented by @phimuemue ).
Implemented Enum for () (unit type) and core::cmp::Ordering (implemented by @phimuemue).
Implemented EnumMap::into_array.
EnumMap::len is now usable in const contexts.
EnumMap::len is now usable in const contexts.Enum derive now can deal with re-definitions of usize andunimplemented.EnumMap::from_array is now usable in const contexts.
EnumMap::from_array is now usable in const contexts.Implemented DoubleEndedIterator for IntoIter.
Implemented DoubleEndedIterator for IntoIter.
Implemented EnumMap::into_values.
IntoIter so that it drops rest of the elements
when one destructor panics.Optimized performance of enum_map! macro.
enum_map! macro.Fixed safety problem when using enum_map! macro with enums that incorrectly implemented Enum trait.
enum_map! macro with enums that
incorrectly implemented Enum trait.Adjusted crate metadata to avoid lib.rs warnings.
Implemented FromIterator for EnumMap (implemented by @bit_network on GitLab).
Implemented FromIterator for EnumMap (implemented by @bit_network
on GitLab).
Implemented EnumMap::map.
Derives support product types in addition to sum types (implemented by @bzim on GitLab).
It's now possible to access enum length by accessing LENGTH in
Enum trait.
Enum trait was split into two traits, Enum and EnumArray.Nothing published for this version
Nothing published for this version
Worked around a bug in Clippy that caused false positives when using use_self lint for code that derived Enum trait.
use_self lint for code that derived Enum trait.Implemented Arbitrary for maps where the value type also implements Arbitrary. (You have to enable the "arbitrary" feature.)
Arbitrary for maps where the value type also implements
Arbitrary. (You have to enable the "arbitrary" feature.)Removed previously deprecated features.
It's now possible to use return and ? within macro_rules! macro.
Enum trait is much simpler having two methods only.
Removed previously deprecated features.
Renamed to_usize to into_usize matching the naming convention
used in Rust programming language.
Nothing published for this version
Deprecated EnumMap::is_empty and EnumMap::new. EnumMap::new usages can be replaced with EnumMap::default.
EnumMap::is_empty and EnumMap::new. EnumMap::new usages
can be replaced with EnumMap::default.Deprecated EnumMap::as_ptr and EnumMap::as_mut_ptr.
EnumMap::as_ptr and EnumMap::as_mut_ptr.Iter and Values now implements Clone (added by @amanieu).
Iter and Values now implements Clone (added by @amanieu).Added EnumMap#clear method (added by @Riey, thanks :)).
EnumMap#clear method (added by @Riey, thanks :)).Nothing published for this version
## Incompatible changes - Now requires Rust 1.36.
Fixed the issue where an aliasing From trait implementation caused compilation errors with enum_map! macro.
From trait implementation caused
compilation errors with enum_map! macro.Default serde features are disabled. This allows enabling serde feature when compiling without std.
serde features are disabled. This allows enabling serde feature when
compiling without std.Change of #[derive(EnumMap)] to #[derive(Enum)] was supposed to appear in 0.3.0, but it was forgotten about. This release fixes just that.
Change of #[derive(EnumMap)] to #[derive(Enum)] was supposed to appear in 0.3.0,
but it was forgotten about. This release fixes just that.
#[derive(EnumMap)] to #[derive(Enum)] to match trait name.Nothing published for this version
Updated README use #[derive(EnumMap)] instead of #[derive(Enum)].
#[derive(EnumMap)] instead of #[derive(Enum)].Implemented compact serde serialization for binary formats like bincode.
Implemented compact serde serialization for binary formats like bincode.
Iterator traits with exception now implement FusedIterator.
Increased required Rust version to 1.26.0.
Renamed Internal trait to Enum.
Added new associated constant POSSIBLE_VALUES to Enum trait,
representing the number of possible values the type can have. Manual
implementations are required to provide it.
Removed Enum implementation for Option<T>.
Implemented compact serialization, for formats like bincode. This
makes it impossible to deserialize non-compact representation used by
enum-map 0.2.0.
values method returns Values<V> as opposed to slice::Iter<V>.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →