This is a derive procedural macro that will let you add custom derive
and attributes over structs, enums and unions. This derive will add two impl on the
type. The as_string() method returns a json serialized string representation of the type
with any meta information annotated with structype_meta("key"=val) attribute,
while the print_fields() method will print the same to STDOUT.
This macro will panic at compile time if annotated over tuple and unit structs.
Example:
use StrucType;
// #[structype_meta("labelover_ride=name")] This will panic the macro
The above will generate and return a json serialized string representation where the key is
the struct's field name and the value is a HashMap<String, String> of structype_meta's key-val. If the structype_meta is
absent, the field's associated value would be an empty {}.
Output:
If this serialized string needs to be deserialized into a struct, use the same type used here
cargo.toml:
= "3.0.0"
Example:
use TypeMapVec;
use StrucType;