#serialization #deserialize #serde #utilities

serde-decimal

Careful serialization of rust_decimal types

3 releases

0.2.5 Sep 15, 2025
0.2.4 Jul 1, 2025
0.2.3 Jun 30, 2025

#1562 in Encoding

Download history 230/week @ 2025-08-06 282/week @ 2025-08-13 326/week @ 2025-08-20 1277/week @ 2025-08-27 2167/week @ 2025-09-03 3064/week @ 2025-09-10 2132/week @ 2025-09-17 2365/week @ 2025-09-24 1661/week @ 2025-10-01 1016/week @ 2025-10-08 1455/week @ 2025-10-15 1491/week @ 2025-10-22 1614/week @ 2025-10-29 1682/week @ 2025-11-05 1374/week @ 2025-11-12 1778/week @ 2025-11-19

6,736 downloads per month

MIT/Apache

41KB
1K SLoC

Careful serialization and deserialization of rust_decimal types.

Several tests in these modules will fail if one were to naively apply e.g., #[serde(with = "rust_decimal::serde::float_option")]. This module provides alternative modules to be used with #[serde(with = ...)]. This circumvents bugs in the rust_decimal::serde modules and adds modules for serialization and deserialization of Option<Option<Decimal>>.

  • use [double_option_float] for Option<Option<Decimal>> where the field may be missing and may be null.
  • use [non_required_float] for Option<Decimal> where the field may be missing but may not be null.
  • use [nullable_float] for Option<Decimal> where the field is required but may be null.
  • use [double_option_str] for Option<Option<Decimal>> where the field may be missing and may be null.
  • use [non_required_str] for Option<Decimal> where the field may be missing but may not be null.
  • use [nullable_str] for Option<Decimal> where the field is required but may be null.
  • use double_option_arbitrary_precision for Option<Option<Decimal>> where the field may be missing and may be null.
  • use non_required_arbitrary_precision for Option<Decimal> where the field may be missing but may not be null.
  • use nullable_arbitrary_precision for Option<Decimal> where the field is required but may be null.

Dependencies

~0.7–1.2MB
~24K SLoC