Module bson::serde_helpers::uuid_as_java_legacy_binary
source · 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
Java driver UUID format and deserialize uuid_0_8::Uuid
from a crate::Binary
in the
legacy Java driver format.
#[cfg(feature = "uuid-0_8")]
use serde::{Serialize, Deserialize};
use uuid_0_8::Uuid;
use bson::serde_helpers::uuid_as_java_legacy_binary;
#[derive(Serialize, Deserialize)]
struct Item {
#[serde(with = "uuid_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.