1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
//! # Hodgepodge
//!
//! `hodgepodge` bundles ready-made enums you can drop into lessons,
//! prototypes, demos, and coding exercises. Each enum doubles as a small dataset
//! (CSS color keywords, RGB swatches, the periodic table, geography trivia, game
//! pieces, etc.) so you can focus on explaining a concept instead of inventing
//! sample data.
//!
//! Bring everything into scope with `use hodgepodge::*;`, then iterate over the
//! variants through `ALL` (or with the `strum` feature), format their values, or serialize them
//! (with the `serde` feature) depending on what the example calls for.
//!
//! ## Names, equality, and lookup
//!
//! Every enum dataset implements `Copy`, `Clone`, `PartialEq`, `Eq`, `Hash`, `Display`,
//! and `FromStr`. `as_str()` and `Display` return the Rust variant name.
//! Parsing ignores ASCII case but requires the complete name without whitespace.
//! These operations require no optional features or runtime dependencies.
//! Every enum dataset also exposes `ALL`, `COUNT`, and a human-readable `label()`,
//! with generic access through [`Dataset`].
//!
//! ```
//! use hodgepodge::{Month, CSS};
//!
//! let month: Month = "september".parse()?;
//! assert_eq!(month, Month::September);
//! assert_eq!(month.to_string(), "September");
//! assert_eq!(CSS::Aqua.rgb(), CSS::Cyan.rgb());
//! assert_ne!(CSS::Aqua, CSS::Cyan); // Different names, identical colors.
//! # Ok::<(), hodgepodge::ParseEnumError>(())
//! ```
//!
//! ## Dataset scope
//!
//! Reference fixtures cover chemistry, geography, anatomy, ecology, and geologic
//! time. Bone counts use the conventional 206-bone adult skeleton; muscle names
//! are a teaching selection. Consult each enum's documentation for its scope.
//!
//! ## Feature-gated helpers
//!
//! * `strum` – enables iteration and variant counts for every dataset, re-exporting
//! `IntoEnumIterator` and `EnumCount` so you can use these traits without
//! depending on `strum` directly.
//! * `enum-iter` / `enum-count` – legacy compatibility feature names that now
//! simply forward to `strum`.
//! * `serde` – enables `serde::Serialize` and `serde::Deserialize` so the
//! enums and cards can be persisted in fixtures for tutorials or quick prototypes.
//! * `rand` – uniform variant sampling and card shuffling with a caller-supplied
//! rand 0.9 RNG. Samples use replacement; consume a shuffled deck to deal unique cards.
//!
//! * `taxonomy` – a shared `Species` enum with hierarchical aliases, backed by
//! source records, ancestry, intermediate ranks, and Wikipedia links; see the
//! `taxonomy` module when enabled.
//! The data carries CC BY 4.0 attribution in addition to the software license.
//!
//! ## Examples
//!
//! ### Iterate through datasets
//! ```rust
//! # #[cfg(feature = "strum")]
//! # {
//! use hodgepodge::{Element, IntoEnumIterator};
//!
//! for element in Element::iter() {
//! let atomic_number = element.atomic_number();
//! println!("{element:?} is element {atomic_number}");
//! }
//! # }
//! # #[cfg(not(feature = "strum"))]
//! # {
//! # // Enable the `strum` feature to run this example.
//! # }
//! ```
//!
//! ### Format CSS color hex values
//! ```rust
//! use hodgepodge::CSS;
//!
//! let swatch = CSS::Tomato;
//! println!("{swatch:?} renders as #{swatch:06x}");
//! ```
//!
//! ### Serialize and deserialize enums
//! ```rust
//! # #[cfg(feature = "serde")]
//! # {
//! use hodgepodge::Day;
//!
//! let json = serde_json::to_string(&Day::Friday).expect("serialize Day");
//! let day: Day = serde_json::from_str(&json).expect("deserialize Day");
//! assert_eq!(day, Day::Friday);
//! # }
//! # #[cfg(not(feature = "serde"))]
//! # {
//! # // Enable the `serde` feature to run this example.
//! # }
//! ```
//!
//! ### Work with seasons and fiscal quarters
//! ```rust
//! use hodgepodge::{Quarter, Season};
//!
//! let midyear = Season::Summer;
//! let fiscal = Quarter::Q4;
//!
//! assert_eq!(midyear as u8, 3);
//! assert_eq!(fiscal as u8, 4);
//! ```
pub use ParseEnumError;
pub use ;
pub use EnumValueError;
/// Metadata shared by every enum dataset, without optional features.
///
/// `ALL` follows declaration order. Labels are presentation text; use `as_str()`
/// for canonical names accepted by `FromStr` and used by JSON serialization.
/// Other Serde formats may encode enum indexes; they are not stable storage IDs.
// Compile the migration and README snippets along with the API examples.
/// Color palettes ranging from ROYGBIV to CSS keywords.
pub use *;
/// Science-themed datasets such as planets and SI prefixes.
pub use *;
/// Geographic datasets covering continents, regions, and states.
pub use *;
/// Temporal datasets including months and weekdays.
pub use *;
/// Games and leisure datasets like playing card suits and ranks.
pub use *;
/// Miscellaneous grab-bag datasets for playful examples.
pub use *;
/// DNA/RNA bases, standard-code codons, and the twenty standard amino acids.
pub use *;
/// Individual adult bones and selected skeletal muscle types.
pub use *;
/// Terrestrial biome categories.
pub use *;
/// Rocks, Earth layers, and the hierarchy of geologic time.
pub use *;
/// Literary datasets such as Dante's circles of Hell.
pub use *;
/// A sourced animal taxonomy with parent/child traversal and Wikipedia links.
/// Re-export helper traits from `strum` when the relevant feature is enabled.
pub use ;