-
-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Labels
feature requestA new feature is requestedA new feature is requested
Description
This issue is based on prior thoughts in the alternatives section of the docs.
Design
I don't have a good design for the attribute yet. There are many unresolved questions.
- What should be the name of the attribute? The name should make it clear that it generates setter(s?) that extend a collection (
push(front or back? forVecDeque),insert). - Where should the attribute reside? Should it be at the level of
#[builder(attr_name)]or#[builder(setters(attr_name))]? - Should the setter accept
Selfby&mutor by value? The typestate won't change after a value is pushed into a colleciton, so&mut selfis possible. However by value seems like a more natural fit to the current design where the setters always requireselfby value.- Maybe we should generate a couple of setters for
&mutand by-valueself? - What name pattern would this couple of setters use?
- How much configrability should we provide for this?
- Maybe we should generate a couple of setters for
Do We Need This At All?
How often would people want such setters? If that would be needed at a rare occasion, then people could use custom fields (#189) with custom methods to implement this.
I'll keep this issue on hold
Prior Art
#[builder(setter(each))]inderive_builder- Implicit special setters for collections in
buildstructor - Java Lombok @Singular
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.
artob, Chaoses-Ib and lu-zero
Metadata
Metadata
Assignees
Labels
feature requestA new feature is requestedA new feature is requested