Module valence::uuid::serde::braced

source ·
Expand description

Serialize from a Uuid as a uuid::fmt::Braced

§Example

#[derive(serde_derive::Serialize, serde_derive::Deserialize)]
struct StructA {
    // This will change both serailization and deserialization
    #[serde(with = "uuid::serde::braced")]
    id: uuid::Uuid,
}

#[derive(serde_derive::Serialize, serde_derive::Deserialize)]
struct StructB {
    // This will be serialized as uuid::fmt::Urn and deserialize from all valid formats
    #[serde(serialize_with = "uuid::serde::braced::serialize")]
    id: uuid::Uuid,
}

Functions§