PackageTrack
Sign in Get early access

enum-map

A map with C-like enum keys represented internally as an array

3.1.0 47M downloads/mo #1264 most downloaded on crates.io source

What this package is like to depend on

Last release 1 months ago

21 Jul 2026

Ships unpredictably

gaps range from 8 days to 2.7 years

Some releases are documented

notes for 30 of 73 stable releases

8 versions withdrawn

withdrawn after publishing

9 years old

82 releases · first in 2017

2 releases in the last 12 months

see the full history below

Release timeline

82 releases · May 2017 to Jul 2026
2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 60 of 82
  1. 3.1.0 21 Jul 2026
    Release notes

    New features

    • Exposed Array trait, to make accessing Enum's length easier.

    Incompatible changes

    • 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.

    Open source →
    Release notes

    New features

    • Exposed Array trait, to make accessing Enum's length easier.

    Incompatible changes

    • 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.

    Open source →
  2. 3.0.0 20 Jul 2026 withdrawn
    Release notes

    New features

    • Implemented EnumMap::try_from_fn and EnumMap::try_map.
    • Added bytemuck feature, allowing using EnumMap with bytemuck crate.

    Incompatible changes

    • Now requires Rust 1.85.
    Open source →
    Release notes

    New features

    • Implemented EnumMap::try_from_fn and EnumMap::try_map.
    • Added bytemuck feature, allowing using EnumMap with bytemuck crate.

    Incompatible changes

    • Now requires Rust 1.85.
    Open source →
  3. 3.0.0-beta.2 08 Nov 2023 pre-release withdrawn
    Release notes

    Other changes

    • Updated author name.
    Open source →
  4. 3.0.0-beta.1 23 Oct 2023 pre-release withdrawn
    Release notes

    New features

    • Implemented EnumMap::from_fn.
    • derive feature is now an optional default feature.
    Open source →
    Release notes

    New features

    • Implemented EnumMap::from_fn.
    • derive feature is now an optional default feature.
    Open source →
  5. 3.0.0-0.gat.0 23 Sep 2023 pre-release withdrawn
    Release notes

    Breaking changes

    • 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.
    Open source →
  6. 2.7.3 24 Nov 2023
    Release notes Open source →
    Release notes Open source →
  7. 2.7.2 16 Nov 2023 withdrawn
    Release notes

    Other changes

    • Reduced RAM usage and improved compilation times when using derive(Enum)
      for large enums with overflow-checks enabled.
    Open source →
    Release notes

    Other changes

    • Reduced RAM usage and improved compilation times when using derive(Enum) for large enums with overflow-checks enabled.
    Open source →
  8. 2.7.1 08 Nov 2023
    Release notes

    Other changes

    • Updated author name.
    Open source →
    Release notes

    Other changes

    • Updated author name.
    Open source →
  9. 2.7.0 20 Oct 2023
    Release notes

    New features

    • Implemented EnumMap::from_fn.
    Open source →
    Release notes

    New features

    • Implemented EnumMap::from_fn.
    Open source →
  10. 2.6.3 10 Sep 2023
    Release notes

    Other changes

    • Updated the repository URL as the project was migrated from GitHub to Codeberg.

    • This project is now compliant with the REUSE Specification.

    Open source →
    Release notes

    Other changes

    • Updated the repository URL as the project was migrated from GitHub to Codeberg.

    • This project is now compliant with the REUSE Specification.

    Open source →
  11. 2.6.2 07 Sep 2023
    Release notes

    Other changes

    • Hide out_of_bounds reexport from documentation.
    Open source →
    Release notes

    Other changes

    • Hide out_of_bounds reexport from documentation.
    Open source →
  12. 2.6.1 01 Aug 2023
    Release notes

    Other changes

    • Provide better panic message when providing out-of-bounds index to `Enum::from_usize``.
    Open source →
    Release notes

    Other changes

    • Provide better panic message when providing out-of-bounds index to `Enum::from_usize``.
    Open source →
  13. 2.6.0 30 Jun 2023
    Release notes

    New features

    • EnumMap::as_array is now usable in const contexts.

    Other changes

    • 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.

    Open source →
    Release notes

    New features

    • EnumMap::as_array is now usable in const contexts.

    Other changes

    • 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.

    Open source →
  14. 2.5.0 14 Mar 2023
    Release notes

    New features

    • Implemented EnumMap::as_array and EnumMap::as_mut_array (implemented by @Fuuzetsu).
    • Implemented PartialOrd and Ord for EnumMap (implemented by @nicarran).

    New Contributors

    Full Changelog: https://github.com/xfix/enum-map/compare/v2.4.2...v2.5.0

    Open source →
    Release notes

    New features

    • Implemented EnumMap::as_array and EnumMap::as_mut_array (implemented by @Fuuzetsu).

    • Implemented PartialOrd and Ord for EnumMap (implemented by @nicarran).

    Open source →
  15. 2.4.2 17 Dec 2022
    Release notes

    Other changes

    • Added license files to crate tarball.
    • Added changelog to crate tarball.

    New Contributors

    Full Changelog: https://github.com/xfix/enum-map/compare/v2.4.1...v2.4.2

    Open source →
    Release notes

    Other changes

    • Added license files to crate tarball.
    • Added changelog to crate tarball.
    Open source →
  16. 2.4.1 28 Jul 2022
    Release notes

    Other changes

    • Improved performance of code generated for from_usize when deriving Enum. Fixes #23.
    Open source →
    Release notes

    Other changes

    • Improved performance of code generated for from_usize when deriving Enum.
    Open source →
  17. 2.4.0 15 Jun 2022
    Release notes

    New features

    • Implemented Enum for () (unit type) and core::cmp::Ordering (implemented by @phimuemue).

    • Implemented EnumMap::into_array.

    Open source →
    Release notes

    New features

    • Implemented Enum for () (unit type) and core::cmp::Ordering (implemented by @phimuemue).

    • Implemented EnumMap::into_array.

    Open source →
  18. 2.3.0 29 May 2022
    Release notes

    New features

    • EnumMap::len is now usable in const contexts.

    Other changes

    • Enum derive now can deal with re-definitions of usize and
      unimplemented.
    Open source →
    Release notes

    New features

    • EnumMap::len is now usable in const contexts.

    Other changes

    • Enum derive now can deal with re-definitions of usize and unimplemented.
    Open source →
  19. 2.2.0 20 May 2022
    Release notes

    New features

    • EnumMap::from_array is now usable in const contexts.
    Open source →
  20. 2.1.0 24 Mar 2022
    Release notes

    New features

    • Implemented DoubleEndedIterator for IntoIter.

    • Implemented EnumMap::into_values.

    Other changes

    • Changed behavior of IntoIter so that it drops rest of the elements when one destructor panics.
    Open source →
  21. 2.0.3 26 Feb 2022
    Release notes

    Other changes

    • Optimized performance of enum_map! macro.
    Open source →
  22. 2.0.2 17 Feb 2022
    Release notes

    Other changes

    • Fixed safety problem when using enum_map! macro with enums that incorrectly implemented Enum trait.
    Open source →
  23. 2.0.1 27 Jan 2022 withdrawn
    Release notes

    Other changes

    • Adjusted crate metadata to avoid lib.rs warnings.
    Open source →
  24. 2.0.0 10 Jan 2022 withdrawn
    Release notes

    New features

    • 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.

    Breaking changes

    • Enum trait was split into two traits, Enum and EnumArray.
    Open source →
  25. 2.0.0-2 04 Jan 2022 pre-release withdrawn

    Nothing published for this version

  26. 2.0.0-1 01 Oct 2021 pre-release

    Nothing published for this version

  27. 1.1.1 16 May 2021
    Release notes

    Other changes

    • Worked around a bug in Clippy that caused false positives when using use_self lint for code that derived Enum trait.
    Open source →
  28. 1.1.0 04 May 2021
    Release notes

    New features

    • Implemented Arbitrary for maps where the value type also implements Arbitrary. (You have to enable the "arbitrary" feature.)
    Open source →
  29. 1.0.0 28 Mar 2021
    Release notes

    New features

    • It's now possible to use return and ? within macro_rules! macro.

    • Enum trait is much simpler having two methods only.

    Other changes

    • Removed previously deprecated features.

    • Renamed to_usize to into_usize matching the naming convention used in Rust programming language.

    Open source →
  30. 0.6.6 18 Feb 2022

    Nothing published for this version

  31. 0.6.5 18 Feb 2022
    Release notes

    Other changes

    • Deprecated EnumMap::is_empty and EnumMap::new. EnumMap::new usages can be replaced with EnumMap::default.
    Open source →
  32. 0.6.4 27 Oct 2020
    Release notes

    Other changes

    • Deprecated EnumMap::as_ptr and EnumMap::as_mut_ptr.
    Open source →
  33. 0.6.3 08 Sep 2020
    Release notes

    New features

    • Iter and Values now implements Clone (added by @amanieu).
    Open source →
  34. 0.6.2 20 Dec 2019
    Release notes

    New features

    • Added EnumMap#clear method (added by @Riey, thanks :)).
    Open source →
  35. 0.6.1 04 Oct 2019

    Nothing published for this version

  36. 0.6.0 29 Jul 2019
    Release notes

    Incompatible changes

    • Now requires Rust 1.36.
    Open source →
  37. 0.5.0 18 Jan 2019
    Release notes
    • Fixed the issue where an aliasing From trait implementation caused compilation errors with enum_map! macro.

    Incompatible changes

    • Now requires Rust 1.31.
    Open source →
  38. 0.4.1 11 Jun 2018
    Release notes

    New features

    • Default serde features are disabled. This allows enabling serde feature when compiling without std.
    Open source →
  39. 0.4.0 06 Jun 2018
    Release notes

    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.

    Incompatible changes

    • Changed #[derive(EnumMap)] to #[derive(Enum)] to match trait name.
    Open source →
  40. 0.3.2 11 Jun 2018

    Nothing published for this version

  41. 0.3.1 06 Jun 2018
    Release notes
    • Updated README use #[derive(EnumMap)] instead of #[derive(Enum)].
    Open source →
  42. 0.3.0 05 Jun 2018
    Release notes

    New features

    • Implemented compact serde serialization for binary formats like bincode.

    • Iterator traits with exception now implement FusedIterator.

    Incompatible changes

    • 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>.

    Open source →
  43. 0.2.36 11 Jun 2018

    Nothing published for this version

  44. 0.2.35 06 Jun 2018

    Nothing published for this version

  45. 0.2.34 05 Jun 2018

    Nothing published for this version

  46. 0.2.33 05 Jun 2018

    Nothing published for this version

  47. 0.2.32 05 Jun 2018

    Nothing published for this version

  48. 0.2.31 22 May 2018

    Nothing published for this version

  49. 0.2.30 18 May 2018

    Nothing published for this version

  50. 0.2.29 20 Apr 2018

    Nothing published for this version

  51. 0.2.28 09 Apr 2018

    Nothing published for this version

  52. 0.2.27 30 Mar 2018

    Nothing published for this version

  53. 0.2.26 30 Mar 2018

    Nothing published for this version

  54. 0.2.25 30 Mar 2018

    Nothing published for this version

  55. 0.2.24 17 Jan 2018

    Nothing published for this version

  56. 0.2.23 30 Nov 2017

    Nothing published for this version

  57. 0.2.22 18 Nov 2017

    Nothing published for this version

  58. 0.2.21 06 Nov 2017

    Nothing published for this version

  59. 0.2.20 15 Sep 2017

    Nothing published for this version

  60. 0.2.19 11 Sep 2017

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive