Introduce derive macro attribute processing (Take 2) #130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pr includes all of the changes from @taiki-e 's pr from several years ago: #75. It looks like that pr lost traction, so I am hoping to give it new life because I would like to use the features it provides as well at the one new attribute I am introducing.
The original pr included the entire mechanism for processing derive-macro attributes, and utilizing them to allow users to
#[valuable(skip)]
- fields that should not be included#[valuable(transparent)]
- omit types that simply wrap others#[valuable(rename = "new_name")]
- provide a replacement nameMy only contribution to this is:
#[valuable(format = "{:#}")]
- Allow for types that don't implementValuable
to included by inserting them a formatted stringI am happy to restructure or add to this pr to help it get incorporated it faster. I'm not sure why the original pr wasn't merged, but it still seems like a very useful feature. Thanks!