Module serde

Source
Available on crate feature serde only.
Expand description

Hex encoding with serde.

The functions in this module de/serialize as hex only when the serializer is human readable.

§Examples

use hex_conservative as hex;
use serde::{Serialize, Deserialize};

#[derive(Debug, Serialize, Deserialize)]
struct Foo {
    #[serde(with = "hex::serde")]
    bar: Vec<u8>,
}

Structs§

SerializeBytesAsHex
Byte slice wrapper to serialize as a hex string in lowercase characters.
SerializeBytesAsHexLower
Byte slice wrapper to serialize as a hex string in lowercase characters.
SerializeBytesAsHexUpper
Byte slice wrapper to serialize as a hex string in uppercase characters.

Functions§

deserialize
Deserializes a hex string into raw bytes.
serialize
Serializes data as a hex string using lowercase characters.
serialize_lower
Serializes data as a hex string using lowercase characters.
serialize_upper
Serializes data as hex string using uppercase characters.