Module safe_integer

Module safe_integer 

Source
Expand description

Serde with modules for bare u64/i64 fields and their Option variants.

These are automatically added by the #[json_safe_fields] attribute macro. You should not normally need to reference them directly.

§Behavior

  • JSON (is_human_readable() == true): values > MAX_SAFE_INTEGER (2^53 - 1) are serialized as strings. Deserialization accepts both numbers and strings.
  • platform_value / bincode (is_human_readable() == false): native integer representation, no transformation.

§Available modules

Modules§

json_safe_i64
Serde with module for i64 fields.
json_safe_option_i64
Serde with module for Option<i64> fields.
json_safe_option_u64
Serde with module for Option<u64> fields.
json_safe_u64
Serde with module for u64 fields.