[Rust] Add an option to use Rust native enum

オープン
#4,177 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@BaldDemian がすでに取り組んでいます。

2026年10月15日 から。

  • #4185 @BaldDemian による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
backend

調査の方向性

The issue concerns the #[ForyUnon] attribute on Rust enums and the rule that picks the xlang union representation when a variant has 2+ fields. Start by finding where that attribute and the field-count check are handled in the Rust derive code, and decide how a user-facing option should select the native enum instead. Done means a user can choose native enum output explicitly, without an Unknown variant, with the choice covered by tests. The design of the option's name and behaviour should be agreed with maintainers first.

索引モデルが issue の本文から書いたものです。

説明

Feature Request

#[ForyUnon] enum T { .. } can be

  1. Xlang union, which requires me to add Unknown variant
  2. Rust native enum, which does not require me to Unknown variant

The problem is that there is no way to tell Fory to use 2.
It's automatically decided by the existence of a variant with 2+ fields.

Is your feature request related to a problem? Please describe

No response

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

主要言語
Java
スター
4.6k
フォーク
470
平均マージ
9時間 28分
マージ済み PR(30日)
33

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/fory のほかの issue

apache/fory の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。