urlyy opened a new pull request, #2528:
URL: https://github.com/apache/fory/pull/2528

   ## Why?
   Rust does not support objects being `null`; instead, it uses the `Option` 
type to wrap nullable objects. In the current Rust macros, `Option<T>` is 
extracted as `MetaFieldType { name: "Option", generics: [T] }`, and then 
compared with the `MetaFieldType { name: T, generics: [] }` received from the 
sender peer like java. This causes a type mismatch. Therefore, the `Option` 
type requires special handling.
   
   ## What does this PR do?
   - support `Option` in MetaFieldType se/de. Specifically, during Rust peer 
serialization, I will serialize `Option<T>` as `(T::type_id, nullable=true)`. 
During deserialization, `(T::type_id, nullable=true)` will be converted to 
`Option<T>`, while `(T::type_id, nullable=false)` will be converted to `T`.
   - correct the previous mistake in #2492, rename `FieldId` to `TypeId`.
   
   ## notice
   It doesn’t support handling adjacent Options, such as Option<Option<T>>.
   
   ## Related issues
   #2526
   
   ## Does this PR introduce any user-facing change?
   
   - [ ] Does this PR introduce any public API change?
   - [ ] Does this PR introduce any binary protocol compatibility change?
   
   ## Benchmark
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to