Module ulid::serde::ulid_as_u128[][src]

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

Deserializes a ULID from a u128 type.

Serializes a ULID as a u128 type.