Available on crate feature uuid-0_8 only.
Expand description

Contains functions to serialize a uuid_0_8::Uuid to a crate::Binary in the legacy Python driver UUID format and deserialize uuid_0_8::Uuid from a crate::Binary in the legacy Python driver format.

use serde::{Serialize, Deserialize};
use uuid_0_8::Uuid;
use bson::serde_helpers::uuid_as_python_legacy_binary;

#[derive(Serialize, Deserialize)]
struct Item {
    #[serde(with = "uuid_as_python_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.