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