-
Notifications
You must be signed in to change notification settings - Fork 149
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::Timestampjiff::Timestamp
abr-egn
left a comment
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 |
isabelatkinson
left a comment
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::Timestampjiff::Timestamp
feat: Add interoperability with
jiff::TimestampHi!
This PR introduces interoperability with the
jiff(docs) crate by adding helpers to convert betweenjiff::Timestampandbson::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 withchronoto add features and tests.Changes included:
jiffas an optional dependency under thejiff-0_2feature flag.serde_withhelper,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!