Crate option_constructor_derive [−] [src]
Example:
#[macro_use] extern crate option_constructor_derive; #[derive(OptionConstructor, Debug, PartialEq)] struct Example { field1: bool, field2: Option<bool>, field3: Option<bool>, } fn main() { let x = Example::new(true).field2(false); assert_eq!(x, Example { field1: true, field2: Some(false), field3: None, }); }