macro_rules! stru_t {
($($t:tt)*) => { ... };
}Expand description
Generate anonymous struct type.
Sometimes you may need to know the exact type of an anonymous struct object.
Just like how a named struct type is declared, you declare a field name, followed by a colon, and then its type. Finally, you separate each field with commas.
use structz::*;
type Person = stru_t! {
name: &'static str,
age: u8,
};
let person: Person = stru! {
age: 15,
name: "Alice",
};For cases where the anonymous structs are used as function arguments, it is recommended
that you use the [macro@named_args] instead.