Module serde

Expand description

Serde serialization via consensus encoding

This provides functions for (de)serializing any type as consensus-encoded bytes. For human-readable formats it serializes as a string with a consumer-supplied encoding, for binary formats it serializes as a sequence of bytes (not serialize_bytes to avoid allocations).

The string encoding has to be specified using a marker type implementing the encoding strategy. This crate provides hex encoding via Hex<Upper> and Hex<Lower>

Modules§

hex
Implements hex encoding.

Structs§

Hex
Hex-encoding strategy
With
Helper for #[serde(with = "")].

Traits§

ByteDecoder
Provides an instance of string-to-byte decoder.
ByteEncoder
Provides an instance of byte-to-string encoder.
EncodeBytes
Transforms given bytes and writes to the writer.
IntoDeError
Converts error into a type implementing serde::de::Error