Skip to content

release v2.10.0 #469

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

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bson"
version = "2.9.0"
version = "2.10.0"
authors = [
"Y. T. Chung <[email protected]>",
"Kevin Yeh <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ This crate is available on [crates.io](https://crates.io/crates/bson). To use it

```toml
[dependencies]
bson = "2.9.0"
bson = "2.10.0"
```

Note that if you are using `bson` through the `mongodb` crate, you do not need to specify it in your
Expand Down
65 changes: 44 additions & 21 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
//!
//! ```toml
//! [dependencies]
//! bson = "2.9.0"
//! bson = "2.10.0"
//! ```
//!
//! Note that if you are using `bson` through the `mongodb` crate, you do not need to specify it in
Expand Down Expand Up @@ -208,25 +208,26 @@
//! let redacted_bson = bson::to_bson(&person).unwrap();
//! ```
//!
//! Any types that implement [`Serialize`](serde::Serialize) and [`Deserialize`](serde::Deserialize) can be used in this way. Doing so helps
//! separate the "business logic" that operates over the data from the (de)serialization logic that
//! translates the data to/from its serialized form. This can lead to more clear and concise code
//! that is also less error prone.
//! Any types that implement [`Serialize`](serde::Serialize) and [`Deserialize`](serde::Deserialize)
//! can be used in this way. Doing so helps separate the "business logic" that operates over the
//! data from the (de)serialization logic that translates the data to/from its serialized form. This
//! can lead to more clear and concise code that is also less error prone.
//!
//! ## Working with datetimes
//!
//! The BSON format includes a datetime type, which is modeled in this crate by the
//! [`DateTime`] struct, and the
//! [`Serialize`](serde::Serialize) and [`Deserialize`](serde::Deserialize) implementations for this struct produce and parse BSON datetimes
//! when serializing to or deserializing from BSON. The popular crate [`chrono`](docs.rs/chrono)
//! also provides a [`DateTime`] type, but its [`Serialize`](serde::Serialize) and [`Deserialize`](serde::Deserialize) implementations operate
//! [`Serialize`](serde::Serialize) and [`Deserialize`](serde::Deserialize) implementations for this
//! struct produce and parse BSON datetimes when serializing to or deserializing from BSON. The
//! popular crate [`chrono`](docs.rs/chrono) also provides a [`DateTime`] type, but its
//! [`Serialize`](serde::Serialize) and [`Deserialize`](serde::Deserialize) implementations operate
//! on strings instead, so when using it with BSON, the BSON datetime type is not used. To work
//! around this, the `chrono-0_4` feature flag can be enabled. This flag exposes a number of
//! convenient conversions between [`bson::DateTime`](crate::DateTime) and [`chrono::DateTime`], including the
//! [`serde_helpers::chrono_datetime_as_bson_datetime`]
//! serde helper, which can be used to (de)serialize [`chrono::DateTime`]s to/from BSON datetimes, and
//! the `From<chrono::DateTime>` implementation for [`Bson`], which allows [`chrono::DateTime`] values
//! to be used in the `doc!` and `bson!` macros.
//! convenient conversions between [`bson::DateTime`](crate::DateTime) and [`chrono::DateTime`],
//! including the [`serde_helpers::chrono_datetime_as_bson_datetime`]
//! serde helper, which can be used to (de)serialize [`chrono::DateTime`]s to/from BSON datetimes,
//! and the `From<chrono::DateTime>` implementation for [`Bson`], which allows [`chrono::DateTime`]
//! values to be used in the `doc!` and `bson!` macros.
//!
//! e.g.
//! ``` rust
Expand Down Expand Up @@ -267,8 +268,8 @@
//!
//! ## Minimum supported Rust version (MSRV)
//!
//! The MSRV for this crate is currently 1.64.0. This will be rarely be increased, and if it ever is,
//! it will only happen in a minor or major version release.
//! The MSRV for this crate is currently 1.64.0. This will be rarely be increased, and if it ever
//! is, it will only happen in a minor or major version release.

#![allow(clippy::cognitive_complexity, clippy::derive_partial_eq_without_eq)]
#![doc(html_root_url = "https://docs.rs/bson/2.6.0")]
Expand All @@ -280,18 +281,40 @@ pub use self::{
bson::{Array, Bson, DbPointer, Document, JavaScriptCodeWithScope, Regex, Timestamp},
datetime::DateTime,
de::{
from_bson, from_bson_with_options, from_document, from_document_with_options, from_reader,
from_reader_utf8_lossy, from_slice, from_slice_utf8_lossy, Deserializer,
from_bson,
from_bson_with_options,
from_document,
from_document_with_options,
from_reader,
from_reader_utf8_lossy,
from_slice,
from_slice_utf8_lossy,
Deserializer,
DeserializerOptions,
},
decimal128::Decimal128,
raw::{
RawArray, RawArrayBuf, RawBinaryRef, RawBson, RawBsonRef, RawDbPointerRef, RawDocument,
RawDocumentBuf, RawJavaScriptCodeWithScope, RawJavaScriptCodeWithScopeRef, RawRegexRef,
RawArray,
RawArrayBuf,
RawBinaryRef,
RawBson,
RawBsonRef,
RawDbPointerRef,
RawDocument,
RawDocumentBuf,
RawJavaScriptCodeWithScope,
RawJavaScriptCodeWithScopeRef,
RawRegexRef,
},
ser::{
to_bson, to_bson_with_options, to_document, to_document_with_options, to_raw_document_buf,
to_vec, Serializer, SerializerOptions,
to_bson,
to_bson_with_options,
to_document,
to_document_with_options,
to_raw_document_buf,
to_vec,
Serializer,
SerializerOptions,
},
uuid::{Uuid, UuidRepresentation},
};
Expand Down