Skip to main content

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_encrypted_note
Serde with module for Option<(u32, u32, Vec<u8>)> fields used by the SharedEncryptedNote / PrivateEncryptedNote type aliases on token transitions.
json_safe_option_i64
Serde with module for Option<i64> fields.
json_safe_option_string_u64_tuple
Serde with module for Option<(String, u64)> fields.
json_safe_option_u64
Serde with module for Option<u64> fields.
json_safe_u64
Serde with module for u64 fields.
json_safe_u128
Serde with module for u128 fields.
json_safe_u128_content
Serde with module for a u128 field that is buffered through serde’s Content enum — i.e. a field of an internally-tagged (#[serde(tag = "…")]) enum or struct.