ion-rust icon indicating copy to clipboard operation
ion-rust copied to clipboard

Serde feature complete support

Open desaikd opened this issue 1 year ago • 0 comments

Currently serde is supported under the experimental-serde feature flag. The current support includes the following Ion data type to serde data type mappings:

| Ion data type | Rust data structure                  | Serde data type                                       |
|---------------|--------------------------------------|-------------------------------------------------------|
| int           | u64, i64, u32, i32, u16, i16, u8, i8 | u64, i64, u32, i32, u16, i16, u8, i8                  |
| float         | f32, f64                             | f32, f64                                              |
| decimal       | Decimal(Ion Element API)             | newtype_struct (with name as `$__ion_rs_decimal__`)   |
| timestamp     | Timestamp(Ion Element API)           | newtype_struct (with name as `$__ion_rs_timestamp__`) |
| blob          | byte array                           | byte array                                            |
| clob          | byte array                           | byte array                                            |
| bool          | bool                                 | bool                                                  |
| symbol        | string                               | string                                                |
| string        | string                               | string                                                |
| struct        | struct                               | struct                                                |
| list          | vector                               | seq                                                   |
| null          | None                                 | unit                                                  |

There are still some TODOs left for the complete support of serde:

  • [x] Add parameterized enum support (https://github.com/amazon-ion/ion-rust/pull/733)
  • [ ] Add support for Ion SExpressions
  • [ ] Use new lazy writers for serialization

Following are some more enhancement issues:

  • https://github.com/amazon-ion/ion-rust/issues/712

desaikd avatar Apr 04 '24 19:04 desaikd