Module ulid::serde::ulid_as_u128

source ·
Expand description

Serialization and deserialization of ULIDs through their inner u128 type.

To use it, annotate a field with #[serde(with = "ulid_as_u128")], #[serde(serialize_with = "ulid_as_u128")], or #[serde(deserialize_with = "ulid_as_u128")].

Examples

#[derive(Serialize, Deserialize)]
struct U128Example {
    #[serde(with = "ulid_as_u128")]
    identifier: Ulid
}

Functions