Skip to content

Commit 7ccf82b

Browse files
authored
RUST-870 Support deserializing directly from raw BSON (#276)
This commit also adds support for borrowed deserialization (#231, RUST-688) and fixes RUST-880 and RUST-884.
1 parent 45c1b13 commit 7ccf82b

File tree

17 files changed

+2071
-473
lines changed

17 files changed

+2071
-473
lines changed

.evergreen/config.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ functions:
102102
${PREPARE_SHELL}
103103
.evergreen/run-tests-serde.sh
104104
105+
"run decimal128 tests":
106+
- command: shell.exec
107+
type: test
108+
params:
109+
shell: bash
110+
working_dir: "src"
111+
script: |
112+
${PREPARE_SHELL}
113+
.evergreen/run-tests-decimal128.sh
114+
105115
"compile only":
106116
- command: shell.exec
107117
type: test
@@ -164,6 +174,10 @@ tasks:
164174
commands:
165175
- func: "run serde tests"
166176

177+
- name: "test-decimal128"
178+
commands:
179+
- func: "run decimal128 tests"
180+
167181
- name: "compile-only"
168182
commands:
169183
- func: "compile only"
@@ -180,9 +194,9 @@ axes:
180194
- id: "extra-rust-versions"
181195
values:
182196
- id: "min"
183-
display_name: "1.43 (minimum supported version)"
197+
display_name: "1.48 (minimum supported version)"
184198
variables:
185-
RUST_VERSION: "1.43.1"
199+
RUST_VERSION: "1.48.0"
186200
- id: "nightly"
187201
display_name: "nightly"
188202
variables:
@@ -198,6 +212,7 @@ buildvariants:
198212
- name: "test"
199213
- name: "test-u2i"
200214
- name: "test-serde"
215+
- name: "test-decimal128"
201216

202217
- matrix_name: "compile only"
203218
matrix_spec:

.evergreen/run-tests-decimal128.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
set -o errexit
4+
5+
. ~/.cargo/env
6+
RUST_BACKTRACE=1 cargo test --features decimal128

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ decimal = { version = "2.1.0", default_features = false, optional = true }
5757
base64 = "0.13.0"
5858
lazy_static = "1.4.0"
5959
uuid = "0.8.1"
60+
serde_bytes = "0.11.5"
6061

6162
[dev-dependencies]
6263
assert_matches = "1.2"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ This crate works with Cargo and can be found on
2828
bson = "2.0.0-beta.2"
2929
```
3030

31+
This crate requires Rust 1.48+.
32+
3133
## Overview of BSON Format
3234

3335
BSON, short for Binary JSON, is a binary-encoded serialization of JSON-like documents.

serde-tests/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ authors = ["Kevin Yeh <[email protected]>"]
55
edition = "2018"
66

77
[dependencies]
8-
bson = { path = ".." }
8+
bson = { path = "..", features = ["decimal128"] }
99
serde = { version = "1.0", features = ["derive"] }
10+
pretty_assertions = "0.6.1"
1011

1112
[lib]
1213
name = "serde_tests"

0 commit comments

Comments
 (0)