Skip to main content

Module serialization

Module serialization 

Source

Re-exports§

pub use json::safe_integer::json_safe_i64;
pub use json::safe_integer::json_safe_option_i64;
pub use json::safe_integer::json_safe_option_u64;
pub use json::safe_integer::json_safe_u128;
pub use json::safe_integer::json_safe_u128_content;
pub use json::safe_integer::json_safe_u64;
pub use json::JsonSafeFields;

Modules§

dashcore
Serde with wrappers for types owned by external (dashcore) crates.
json
Compile-safe JSON serialization for large integers (u64/i64).
serde_bytes
Generic serde helper for fixed-size byte arrays [u8; N].
serde_bytes_var
Serde helper for variable-length Vec<u8> byte fields.

Traits§

JsonConvertible
Convert to/from JSON using human-readable serde (Identifier = base58, binary = base64).
PlatformDeserializableFromVersionedStructureTrusted
We will deserialize a versioned structure into a code structure For example we have DataContractV0 and DataContractV1 The system version will tell which version to deserialize into This happens by first deserializing the data into a potentially versioned structure For example we could have DataContractSerializationFormatV0 and DataContractSerializationFormatV1 Both of the structures will be valid in perpetuity as they are saved into the state. So from the bytes we could get DataContractSerializationFormatV0. Then the system_version given will tell to transform DataContractSerializationFormatV0 into DataContractV1 (if system version is 1)
PlatformDeserializableFromVersionedStructureUntrusted
Untrusted twin of PlatformDeserializableFromVersionedStructureTrusted: bytes from outside this node, see PlatformDeserializableUntrusted.
PlatformDeserializableTrusted
Deserialization of bytes this node wrote itself: Drive state read back from GroveDB, wallet storage, locally generated fixtures.
PlatformDeserializableUntrusted
Deserialization of bytes from outside this node: state transitions, query requests and cursors, proofs, SDK responses, host-supplied input.
PlatformDeserializableWithBytesLenFromVersionedStructureTrusted
Versioned deserialization that also reports how many bytes were consumed (see PlatformDeserializableFromVersionedStructureTrusted for how versioned structures decode).
PlatformDeserializableWithBytesLenFromVersionedStructureUntrusted
Untrusted twin of PlatformDeserializableWithBytesLenFromVersionedStructureTrusted: bytes from outside this node, see PlatformDeserializableUntrusted.
PlatformDeserializableWithPotentialValidationFromVersionedStructureTrusted
Versioned deserialization with optional full validation of the decoded structure (see PlatformDeserializableFromVersionedStructureTrusted for how versioned structures decode).
PlatformDeserializableWithPotentialValidationFromVersionedStructureUntrusted
Untrusted twin of PlatformDeserializableWithPotentialValidationFromVersionedStructureTrusted: bytes from outside this node, see PlatformDeserializableUntrusted.
PlatformLimitDeserializableFromVersionedStructureTrusted
Versioned deserialization under the type’s configured byte limit.
PlatformLimitDeserializableFromVersionedStructureUntrusted
Untrusted twin of PlatformLimitDeserializableFromVersionedStructureTrusted: bytes from outside this node, see PlatformDeserializableUntrusted.
PlatformMessageSignable
PlatformSerializable
PlatformSerializableWithPlatformVersion
Signable
ValueConvertible

Attribute Macros§

json_safe_fields
Attribute macro that auto-injects #[serde(with = "...")] on fields whose natural serde shape would round-trip badly through JSON / WASM.

Derive Macros§

JsonConvertible
Derive macro that generates impl JsonConvertible for Type {} with compile-time assertions that all inner types implement JsonSafeFields.
ValueConvertible
Derive macro that generates impl ValueConvertible for Type {}.