字段配置
本页说明如何在 Rust 中配置序列化字段级元信息。
概述
Apache Fory™ 提供 #[fory(...)] 属性宏,用于在编译期声明可选字段级元信息。 This enables:
- Tag IDs: Assign compact numeric IDs to minimize struct field meta size overhead
- Nullability: Control whether fields can be null
- Reference Tracking: Enable reference tracking for shared ownership types
- Field Skipping: Exclude fields from serialization
- Encoding Control: Specify how integers are encoded (varint, fixed, tagged)