#serialization #serde #deserialize #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

#1522 in Encoding

Download history 1002/week @ 2025-08-26 2152/week @ 2025-09-02 2895/week @ 2025-09-09 2239/week @ 2025-09-16 2450/week @ 2025-09-23 1793/week @ 2025-09-30 998/week @ 2025-10-07 1454/week @ 2025-10-14 1382/week @ 2025-10-21 1718/week @ 2025-10-28 1688/week @ 2025-11-04 1307/week @ 2025-11-11 1228/week @ 2025-11-18 2791/week @ 2025-11-25 2167/week @ 2025-12-02 1671/week @ 2025-12-09

8,366 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