You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/oid.rs
+67-2Lines changed: 67 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
-
//! ObjectId
1
+
//! Module containing functionality related to BSON ObjectIds.
2
+
//! For more information, see the documentation for the [`ObjectId`] type.
2
3
3
4
use std::{
4
5
convert::TryInto,
@@ -72,7 +73,71 @@ impl fmt::Display for Error {
72
73
73
74
impl error::ErrorforError{}
74
75
75
-
/// A wrapper around raw 12-byte ObjectId representations.
76
+
/// A wrapper around a raw 12-byte ObjectId.
77
+
///
78
+
/// ## `serde` integration
79
+
/// When serialized to BSON via `serde`, this type produces a BSON ObjectId. In non-BSON formats, it
80
+
/// will serialize to and deserialize from that format's equivalent of the [extended JSON representation](https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/) of a BSON ObjectId.
81
+
///
82
+
/// [`ObjectId`]s can be deserialized from hex strings in all formats.
0 commit comments