Skip to main content

enum_helper/
lib.rs

1//! [![CI](https://github.com/uimataso/enum-helper/actions/workflows/ci.yml/badge.svg)](https://github.com/uimataso/enum-helper/actions/workflows/ci.yml)
2//! [![Latest Version](https://img.shields.io/crates/v/enum-helper.svg)](https://crates.io/crates/enum-helper)
3//! [![Rust Documentation](https://docs.rs/enum-helper/badge.svg)](https://docs.rs/enum-helper)
4//! ![Crates.io](https://img.shields.io/crates/l/enum-helper)
5//! ![Crates.io](https://img.shields.io/crates/d/enum-helper)
6//!
7//! Yet another enum helper.
8//!
9//! This crate provides derive macros that generate common boilerplate for enums.
10//!
11//! - [`EnumStr`]: convert between enum and string
12//! - [`EnumAll`]: get an array of all variants
13//! - [`EnumKind`]: generate a unit kind enum from a data-carrying enum
14//!
15//! ## Feature flags
16//!
17//! - `derive` (default): re-exports derive macros
18//!
19//! [`EnumStr`]: derive@enum_helper_derive::EnumStr
20//! [`EnumAll`]: derive@enum_helper_derive::EnumAll
21//! [`EnumKind`]: derive@enum_helper_derive::EnumKind
22
23#[cfg(feature = "derive")]
24pub use enum_helper_derive::EnumAll;
25#[cfg(feature = "derive")]
26pub use enum_helper_derive::EnumKind;
27#[cfg(feature = "derive")]
28pub use enum_helper_derive::EnumStr;