Crates.io | hodgepodge |
lib.rs | hodgepodge |
version | 0.1.5 |
source | src |
created_at | 2020-08-05 20:58:11.105012 |
updated_at | 2020-08-26 03:08:57.789964 |
description | A hodgepodge of enums |
homepage | https://github.com/cmccomb/hodgepodge |
repository | https://github.com/cmccomb/hodgepodge |
max_upload_size | |
id | 273415 |
size | 33,012 |
The name says it all - this crate is just a hodgepodge of potentially useful enums.
Usage is pretty simple. Import, and use to your heart's desire.
use hodgepodge::*;
fn main() {
println!("{:?}, {:?}, and {:?} are RGB colors", RGB::Blue, RGB::Red, RGB::Green);
}
This library uses strum
and strum_macros
, so you can do things like this:
use hodgepodge::*;
fn main() {
for member in Element::iter() {
println!("{:?} is element {:?}", member.clone(), member as i32);
}
}
And this:
use hodgepodge::*;
fn main() {
println!("There are {:?} elements", Element::iter().count());
}