Module simple

Module simple 

Source
Expand description

Serialize a Uuid as [uuid::fmt::Simple].

§Examples

Serialize and deserialize using the simple format, failing to deserialize any other format:

#[derive(serde_derive::Serialize, serde_derive::Deserialize)]
struct StructA {
    #[serde(with = "uuid::serde::simple")]
    id: uuid::Uuid,
}

Serialize using the simple format, but deserialize any format:

#[derive(serde_derive::Serialize, serde_derive::Deserialize)]
struct StructB {
    #[serde(serialize_with = "uuid::serde::simple::serialize")]
    id: uuid::Uuid,
}

Functions§

deserialize
Deserialize a simple-formatted string as a Uuid.
serialize
Serialize a Uuid as a simple string.