Skip to content

Commit

Permalink
RUST-870 Support deserializing directly from raw BSON (crossterm-rs#276)
Browse files Browse the repository at this point in the history
This commit also adds support for borrowed deserialization (crossterm-rs#231, RUST-688) and fixes RUST-880 and RUST-884.
  • Loading branch information
patrickfreed authored Jul 8, 2021
1 parent 45c1b13 commit 7ccf82b
Show file tree
Hide file tree
Showing 17 changed files with 2,071 additions and 473 deletions.
19 changes: 17 additions & 2 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ functions:
${PREPARE_SHELL}
.evergreen/run-tests-serde.sh
"run decimal128 tests":
- command: shell.exec
type: test
params:
shell: bash
working_dir: "src"
script: |
${PREPARE_SHELL}
.evergreen/run-tests-decimal128.sh
"compile only":
- command: shell.exec
type: test
Expand Down Expand Up @@ -164,6 +174,10 @@ tasks:
commands:
- func: "run serde tests"

- name: "test-decimal128"
commands:
- func: "run decimal128 tests"

- name: "compile-only"
commands:
- func: "compile only"
Expand All @@ -180,9 +194,9 @@ axes:
- id: "extra-rust-versions"
values:
- id: "min"
display_name: "1.43 (minimum supported version)"
display_name: "1.48 (minimum supported version)"
variables:
RUST_VERSION: "1.43.1"
RUST_VERSION: "1.48.0"
- id: "nightly"
display_name: "nightly"
variables:
Expand All @@ -198,6 +212,7 @@ buildvariants:
- name: "test"
- name: "test-u2i"
- name: "test-serde"
- name: "test-decimal128"

- matrix_name: "compile only"
matrix_spec:
Expand Down
6 changes: 6 additions & 0 deletions .evergreen/run-tests-decimal128.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

set -o errexit

. ~/.cargo/env
RUST_BACKTRACE=1 cargo test --features decimal128
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ decimal = { version = "2.1.0", default_features = false, optional = true }
base64 = "0.13.0"
lazy_static = "1.4.0"
uuid = "0.8.1"
serde_bytes = "0.11.5"

[dev-dependencies]
assert_matches = "1.2"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ This crate works with Cargo and can be found on
bson = "2.0.0-beta.2"
```

This crate requires Rust 1.48+.

## Overview of BSON Format

BSON, short for Binary JSON, is a binary-encoded serialization of JSON-like documents.
Expand Down
3 changes: 2 additions & 1 deletion serde-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ authors = ["Kevin Yeh <kevinyeah@utexas.edu>"]
edition = "2018"

[dependencies]
bson = { path = ".." }
bson = { path = "..", features = ["decimal128"] }
serde = { version = "1.0", features = ["derive"] }
pretty_assertions = "0.6.1"

[lib]
name = "serde_tests"
Expand Down
Loading

0 comments on commit 7ccf82b

Please sign in to comment.