mesh_protobuf: support `#[mesh(default)]` to specify default enum variant
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Rust
- Stars
- 1.9k
- Forks
- 238
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 100
Description
This will make it easier to extend saved states.
Notes:
- Should this be required on stable enums? Exception for when it's used as
Option<MyEnum>, or no? Standard protobuf doesn't have this concept foroneof, so probably we should try to supportOption<MyEnum>withoutMyEnumhaving a default. - Maybe having an associated const on
FieldDecodeindicating whether a default exists would be useful. - Should we skip encoding the default when it's present? No: this would mean adding
defaultis a breaking change (since such a message could not be decoded by an old version), and it would not be compatible with standard protobufoneof, which we are trying to emulate.
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start by resolving the design questions in the issue: stable enums, Option, the FieldDecode default indicator, and encoding compatibility. Done means the supported cases and compatibility behavior are explicitly decided and the mesh_protobuf implementation reflects that decision.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100