Available on crate feature uuid-1 only.
Expand description

Contains functions to serialize a uuid::Uuid to a crate::Binary in the legacy C# driver UUID format and deserialize uuid::Uuid from a crate::Binary in the legacy C# driver format.

use serde::{Serialize, Deserialize};
use uuid::Uuid;
use bson::serde_helpers::uuid_1_as_c_sharp_legacy_binary;

#[derive(Serialize, Deserialize)]
struct Item {
    #[serde(with = "uuid_1_as_c_sharp_legacy_binary")]
    pub id: Uuid,
}

Functions

  • Deserializes a Uuid from a Binary in the legacy UUID format.
  • Serializes a Uuid as a Binary in the legacy UUID format.