Luro02 / shorthand

A proc-macro to derive getter, setter and mut getter for structs in rust.
Apache License 2.0
6 stars 0 forks source link

forward setter, getter of struct field #14

Open Luro02 opened 4 years ago

Luro02 commented 4 years ago

It is not possible for a proc_macro to see, which methods are implemented for a struct, so they have to be specified with an attribute

For example the attribute could look like this;

#[shorthand(enable(forward(field = "field", functions = "field", "field_mut", attributes = [])))]

Another useful feature would be conditions; "Forward X only if Y is enabled and Z is disabled."