use atruct::atruct;
fn main() {
let anonymous = atruct!(
string1 @ String: String::from("string1"), string2(String): String::from("string2"),
box_option_vec @ Box<Option<Vec<u8>>>: Box::new(Some(Vec::new())),
vec(Vec<u8>): vec![0, 1, 0, 1, 1],
nest: {
a: "you can define nested struct without prepare lots of named structs",
b: 100usize, },
);
println!("{}", anonymous.string1); println!("{}", anonymous.string2); println!("{:?}", anonymous.box_option_vec); println!("{:?}", anonymous.vec); println!("{}", anonymous.nest.a) }