enum_builder 0.1.6

Simple macros that allow building enum types from variants that can be defined in multiple dispersed files in the crate.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use enum_builder::enum_builder_variant;

use crate::AnimalSound;

#[enum_builder_variant(Animal)]
pub struct Goat(pub usize);

impl<'a> AnimalSound for Goat {
	fn speak(&self) {
		println!("The goat goes{}", " bleat!".repeat(self.0));
	}
}