lombok-macros

Official Documentation
Api Docs
A collection of procedural macros for Lombok-like functionality in Rust.
Features
Installation
To use this crate, you can run cmd:
cargo add lombok-macros
Use
use lombok_macros::*;
#[derive(Lombok, Debug, Clone)]
struct LombokTest<'a, 'b, T: Clone> {
#[get(pub(crate))]
#[set(pub(crate))]
list: Vec<String>,
#[get(pub(crate))]
opt_str_lifetime_a: Option<&'a T>,
#[set(private)]
opt_str_lifetime_b: Option<&'b str>,
}
fn main() {
let mut data: LombokTest<usize> = LombokTest {
list: Vec::new(),
opt_str_lifetime_a: None,
opt_str_lifetime_b: None,
};
let list: Vec<String> = vec!["hello".to_string(), "world".to_string()];
data.set_list(list.clone());
match data.get_list() {
left_val => {
assert_eq!(*left_val, list);
}
}
}
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
Contact
For any inquiries, please reach out to the author at ltpp-universe root@ltpp.vip.