Skip to main content

Module serde_as_consensus

Module serde_as_consensus 

Source
Expand description

serde serialize and deserialize types using consensus encoding.

Use with #[serde(with = "bitcoin_consensus_encoding::serde_as_consensus")].

This module works with any type T that implements both Encode and Decode. In human-readable formats (like JSON), the value is serialized as a hex string. In non-human-readable formats (like bincode), raw bytes are used.

Modules§

opt
serde serialize and deserialize Option<T>.
vec
serde serialize and deserialize Vec<T>.

Functions§

deserialize
Deserializes a type from a consensus-encoded hex string.
serialize
Serializes a type as a consensus-encoded hex string.