1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! 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.