microsoft / microsoft/openvmm

mesh_protobuf: support `#[mesh(default)]` to specify default enum variant

Open
#848 1 comment 0 reactions 0 assignees View on GitHub

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 for oneof, so probably we should try to support Option<MyEnum> without MyEnum having a default.
  • Maybe having an associated const on FieldDecode indicating whether a default exists would be useful.
  • Should we skip encoding the default when it's present? No: this would mean adding default is a breaking change (since such a message could not be decoded by an old version), and it would not be compatible with standard protobuf oneof, which we are trying to emulate.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.