unprolix-0.1.0 doesn't have any documentation.
Unprolix
Remove boilerplate for constructors, getters and setters. Make your code even cleaner!
Unprolix benefits from procedural derive macros.
This version is experimental and was used for a few personal projects. No issues have been found so far, but you are welcome to report any problem.
Examples
use unprolix::{Constructor, Getters, Setters};
mod the_mod {
#[derive(Default)]
pub struct TheModStruct {
a: bool,
}
}
#[derive(Constructor, Getters, Setters)]
struct SomeMultipleZ {
flag: bool,
pub x: usize,
#[unprolix(default, copy)]
y: usize,
z: (u8, u8),
#[unprolix(skip)]
s: u8,
#[unprolix(as_slice)]
l: Vec<i32>,
w: the_mod::TheModStruct,
}
fn main() {
let flag = true;
let x = 5;
let z = (1u8, 2u8);
let s = 0u8;
let l = vec![3, 5, 7];
let w = the_mod::TheModStruct::default();
let mut m = SomeMultipleZ::new(flag, x, z, s, l, w);
assert_eq!(&true, m.flag());
m.set_flag(false);
assert_eq!(&false, m.flag());
let _a: usize = m.y();
let _a: &[i32] = m.l();
m.l_as_mut().push(25);
}