Macros for [r-lombok-macros
]. it's a rust macros that automatically plugs into your editor and build tools,like java
lombok
More information about this crate can be found in the crate documentation.
```rust use std::fmt::Debug; use rlombokmacros::{Getter, Setter};
struct Company {
name: &'static str,
boss: &'static str,
number: u32,
department: Vec
struct CompanyGen
struct CompanyWrap {
sub_company: CompanyGen
// Unit struct
struct UnitStruct {}
fn main() { let mut xp = Company { name: "xp", boss: "Big Brother", number: u32::MAX, department: vec!["HR".toowned(), "Finance".toowned()], }; println!("xp name = {:?} boss = {:?} number = {:?} department = {:?}", xp.getname(), xp.getboss(), xp.getnumber(), xp.getdepartment()); xp.setname("setname"); xp.setboss("setboss"); xp.setnumber(u32::MIN); xp.setdepartment(vec!["department".to_owned()]);
let xp_t = CompanyGen::<Company> {
name: xp,
boss: "Big Brother",
number: u32::MAX,
department: vec!["HR".to_owned(), "Finance".to_owned()],
};
println!("xp_t name = {:?} boss = {:?} number = {:?} department = {:?}", xp_t.get_name(), xp_t.get_boss(), xp_t.get_number(), xp_t.get_department());
let xp_wrap = CompanyWrap {
sub_company: xp_t,
name: "xp_wrap",
};
println!("xp_wrap name = {:?} sub_company = {:?}", xp_wrap.get_name(), xp_wrap.get_sub_company().get_name());
let unit = UnitStruct {};
println!("unit = {:?}", unit);
}
```
see test for more example
You're also welcome to open an [issue] with your question.
This project is licensed under the MIT license.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in r-lombok-macros
by
you, shall be licensed as MIT, without any additional terms or conditions.