Crate const_enum

Source
Expand description

This crate provides a procedural derive macro for constant From trait implementations for enumerations based on their repr type.

Due to offering const support, this library requires the usage of Rust nightly. Additionally, you must add the following feature flags to your crate root:

#![feature(const_trait_impl)]   // always required

This is required as some features are currently gated behind these flags. Further documentation about usage can be found in the individual macro.

Derive Macrosยง

ConstEnum
This function defines the procedural derive macro ConstEnum. It can be used on any enum with a repr type, e.g. repr(u8).