-
Notifications
You must be signed in to change notification settings - Fork 147
RUST-2256 feat: Add integration with jiff::Timestamp
#587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
jiff::Timestamp
jiff::Timestamp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution - this looks good to me! I appreciate the care to follow the existing conventions of the bson crate 🙂. I've authorized the test run, assuming that's green I'll merge this in!
Looks like one of the tests isn't compiling:
|
oops, my bad, I fixed another copy&paste error in one test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the contribution!
jiff::Timestamp
jiff::Timestamp
feat: Add interoperability with
jiff::Timestamp
Hi!
This PR introduces interoperability with the
jiff
(docs) crate by adding helpers to convert betweenjiff::Timestamp
andbson::DateTime
. This allows users ofjiff
, a modern and standards-focused time library, to seamlessly serialize and deserialize timestamps with BSON, I followed the already present integration withchrono
to add features and tests.Changes included:
jiff
as an optional dependency under thejiff-0_2
feature flag.serde_with
helper,datetime::FromJiff02Timestamp
, to enable ergonomic serialization for structs (e.g.,#[serde_as(as = "datetime::FromJiff02Timestamp")]
).DateTime::from_jiff()
andDateTime::to_jiff()
for direct, manual conversions between the two types.Let me know if I missed anything!