bon icon indicating copy to clipboard operation
bon copied to clipboard

Introduce `#[derive(New)]` for deriving the `new()` method

Open Veetaha opened this issue 1 year ago • 0 comments

This is based on the issue https://github.com/elastio/bon/issues/24

Once we have a feature-complete builder derive feature we may add a feature to derive the method new() with positional parameters for the structs.

This will effectively be our wheel that reimplements the features from the derive-new crate.

Note that I'm not yet ready to invest effort into the design of this feature yet. It requires studying the prior art of the derive-new crate first and then determining how this can be integrated into bon, how this may interact with the builder feature etc. It's a big design effort, that I'd rather postpone to the time when the builder derives/macros are feature complete.

A note for the community from the maintainers

Please vote on this issue by adding a 👍 reaction to help the maintainers with prioritizing it. You may add a comment describing your real use case related to this issue for us to better understand the problem domain.

Veetaha avatar Sep 21 '24 14:09 Veetaha