bson-rust
bson-rust copied to clipboard
Encoding and decoding support for BSON in Rust
RUST-1385 This makes public the existing `Binary::as_raw_binary`, and adds the reciprocal `RawBinaryRef::to_binary`. Tagging RUST-1385 because I noticed these didn't exist during implementation of that :)
## Versions/Environment 1. What version of Rust are you using? 1.62.0 2. What operating system are you using? Linux 3. What versions of the driver and its dependencies are you...
Added a Binary constructor that accepts a base64 string instead of the bytes themselves.
When used `bson = "2.3"` directly as dependency, building output the following error message: `error: the wasm32-unknown-unknown target is not supported by default, you may need to enable the "js"...
Due to using `std::time::SystemTime`. A potential solution is exposing a `new_with_timestamp(n_secs_since_unix_epoch: u32) -> Self` constructor. People who want to run on wasm can supply their own timestamp.
According to [BSON 1.1 Spec](http://bsonspec.org/spec.html), it introduced a new type `decimal128`. But currently Rust doesn't support `d128` type natively. Related links 1. `d128` crate: https://github.com/alkis/decimal 2. Official support RFC: https://github.com/rust-num/num/issues/8
Here's an example of a collection with records expiring by `expires_at`: ``` #[collection = "subscriptions"] #[derive(Serialize, Deserialize, Debug, Clone)] pub struct Subscription { #[serde(rename = "_id")] pub id: Option, pub...
When trying to serialize `Serialize` object using `bson::to_vec` it gets to `update_element_type` which returns an error if the top level object is not `ElementType::EmbeddedDocument` [ if matches!(t, ElementType::EmbeddedDocument) {](https://github.com/mongodb/bson-rust/blob/b62338a56f8e63af63b131e918ce3da63094495c/src/ser/raw/mod.rs#L82) Is...
During serialization, `to_vec` can get particularly hot by reallocating a large number of times. This PR adds a method to provide a pre-warmed `Vec` as input to avoid these reallocations....
The `chrono` crate is affected by a difficult to solve CVE that triggers in environments using `cargo-audit` as a security check. As I understand it, there is a feature flag...