Expand description
Contains functions to serialize a uuid::Uuid
to a crate::Binary
in the legacy Python
driver UUID format and deserialize uuid::Uuid
from a crate::Binary
in the legacy Python
driver format.
use serde::{Serialize, Deserialize};
use uuid::Uuid;
use bson::serde_helpers::uuid_1_as_python_legacy_binary;
#[derive(Serialize, Deserialize)]
struct Item {
#[serde(with = "uuid_1_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.