I am trying to write an attribute macro for a proc-macro that would allow me to remove a field from a struct or completely replace its signature.
Something similar to this:
#[derive(my_macro)]
struct OurStruct{
a: i32,
#[my_macro(remove)]
field_to_remove: i32
}
Which should result in:
struct OurStruct{
a: i32,
}
I know how to write macros to add to the impl part of the struct but so far I have problem finding any sample on how to modify the part of the code marked by an attribute-macro.
Is that possible? If so, can you please provide a sample?