Skip to main content

Module serde_utils

Module serde_utils 

Source
Expand description

Serde utilities for hex serialization of types used in JSON RPC.

These are self-contained copies of the helpers from fiber-types, so that fiber-json-types can be compiled without depending on fiber-types.

Modules§

duration_hex
Module for hex serialization of Duration

Structs§

EntityHex
Hash256
A 256-bit hash (32 bytes), serialized as 0x-prefixed hex string.
HexU32
A u32 wrapper that serializes/deserializes as a hex string (“0x…”). Unlike U32Hex (a serde_conv helper for use with #[serde_as]), this type implements Serialize/Deserialize directly, making it suitable for use inside adjacently-tagged enums and other contexts where serde_as doesn’t apply.
Privkey
A private key byte array (32 bytes), serialized as hex without 0x prefix.
Pubkey
A compressed public key (33 bytes), serialized as hex without 0x prefix.
SliceHex
SliceHexNoPrefix
U32Hex
U64Hex
U128Hex

Functions§

from_hex