Crate enum_derived
source ·Expand description
Enum-Derived adds new functionality to unit-like enums
You may be looking for:
Enum-Derived in action
use enum_derived::Rand;
#[derive(Rand, Debug)]
pub enum Dna {
A,
C,
T,
G
}
fn main() {
let base = Dna::rand();
println!("Random Base: ${base:?}");
}