Introduce `#[derive(Setters, Getters)]` to derive simple accessor methods
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by studying the prior art linked in the issue, especially getset, derive_getters, and derive_setters, then review bon's builder derives and macros. Done means agreeing on the accessor API and its integration with the builder feature; the issue explicitly postpones implementation until that design work is complete.
Written by the indexing model from the issue text.
Description
This is based on feature requests #24 and #69.
Once we have a feature-complete builder derive we may add a feature to derive the getter/setter methods directly on the structs/enums.
This will effectively be our wheel that reimplements the features from the getset crate and other alternative crates derive_getters, derive_setters.
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 getset 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.
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 46
- Avg merge
- 53m
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from elastio/bon
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
feature request
Difficulty 4/5 3-5 days Newbie friendliness 38/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
feature request
Difficulty 5/5 Over a week Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100