Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide traits for the given behavior #14

Open
DrSloth opened this issue Jul 11, 2023 · 1 comment
Open

Provide traits for the given behavior #14

DrSloth opened this issue Jul 11, 2023 · 1 comment

Comments

@DrSloth
Copy link

DrSloth commented Jul 11, 2023

Hi,
it would be very useful if the derive macros where based on traits rather than implementing functions directly.
Is this out of scope? If yes i would probably start maintaining a fork which does that.

Thanks in advance

@koivunej
Copy link
Owner

it would be very useful if the derive macros where based on traits rather than implementing functions directly.
Is this out of scope?

Not really, I originally just was not thinking that there could/should be a trait. This was rather an omission by me as I was just content with the duck typing working and moving on to other things.

I was thinking that a trait could be introduced without breaking anyone's codebase by:

  1. add the trait
    • question is what to call the the "sub-crate" with the trait
    • overhauling derive-into-owned to be about the trait and not the proc macro would be quite the breaking change, if even possible
  2. for one release generate trait and inherent methods
    • this should be possible even as a patch/minor release
  3. for the next release drop inherent method generation

This was referenced Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants