Module ulid::serde::ulid_as_uuid

source ·
Expand description

Serialization and deserialization of ULIDs through UUID strings.

To use this module, annotate a field with #[serde(with = "ulid_as_uuid")], #[serde(serialize_with = "ulid_as_uuid")], or #[serde(deserialize_with = "ulid_as_uuid")].

§Examples

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

Functions§

  • Deserializes a ULID from a string containing a UUID.
  • Converts the ULID to a UUID and serializes it as a string.