Skip to content

RUST-870 Support deserializing directly from raw BSON #276

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
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7d1e550
wip raw deserializer
patrickfreed Jun 3, 2021
799f18b
wip binary
patrickfreed Jun 23, 2021
382b742
wip raw deserialization
patrickfreed Jun 24, 2021
4b70b1f
finish datetime deserialization
patrickfreed Jun 28, 2021
761068c
regex deserialization
patrickfreed Jun 28, 2021
845e9f8
dbpointer code code w scope
patrickfreed Jun 28, 2021
ca69e9b
take ownership in to_extended_document
patrickfreed Jun 28, 2021
fdec423
timestamp
patrickfreed Jun 28, 2021
2ca22ea
minkey maxkey
patrickfreed Jun 28, 2021
9030336
decimal128
patrickfreed Jun 28, 2021
45a99ad
combine documentaccess and seqaccess
patrickfreed Jun 28, 2021
488ed41
deduplicate deserialization logic
patrickfreed Jun 28, 2021
3b44841
wip corpus
patrickfreed Jun 28, 2021
6728082
finish corpus
patrickfreed Jun 29, 2021
1f667bb
ensure serde tests are passing, decimal128, enums
patrickfreed Jun 30, 2021
93ca2fe
slice based deserialization
patrickfreed Jul 2, 2021
caa9f5b
borrow keys in Bson deserialization
patrickfreed Jul 2, 2021
3647aa8
Revert "borrow keys in Bson deserialization"
patrickfreed Jul 2, 2021
90942ba
add test for all types
patrickfreed Jul 2, 2021
cc8c8ff
various cleanup
patrickfreed Jul 2, 2021
e14a74f
bump MSRV to 1.48
patrickfreed Jul 2, 2021
916e782
handle overreads
patrickfreed Jul 2, 2021
e9b38d3
consolidate key deserialization
patrickfreed Jul 2, 2021
77668c6
enable decimal128 tests, use $decimal128 instead of $decimal128Bytes
patrickfreed Jul 2, 2021
1ab13af
fully support borrowed deserialization
patrickfreed Jul 2, 2021
a88d7dd
test borrowing some other types
patrickfreed Jul 2, 2021
0511f69
reintroduce support for deserializing decimal128 from extended json
patrickfreed Jul 6, 2021
de68ee9
fix typo
patrickfreed Jul 6, 2021
2db5468
move element type deserialization logic into deserializer
patrickfreed Jul 6, 2021
d10410b
fix typo
patrickfreed Jul 8, 2021
e3036ce
support lossy and non-lossy UTF-8 decoding
patrickfreed Jul 8, 2021
b062873
fix docstring
patrickfreed Jul 8, 2021
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
4 changes: 2 additions & 2 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ axes:
- id: "extra-rust-versions"
values:
- id: "min"
display_name: "1.43 (minimum supported version)"
display_name: "1.48 (minimum supported version)"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The driver is currently on 1.47, but in order to ergonomically convert between a Vec<u8> and an array of bytes for Decimal128, I needed Rust 1.48. I'm sort of thinking we should consider bumping this all the way to the latest stable right before the 2.0.0 release to give us the newest possible version to work with for a while. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm as well

variables:
RUST_VERSION: "1.43.1"
RUST_VERSION: "1.48.0"
- id: "nightly"
display_name: "nightly"
variables:
Expand Down
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 <[email protected]>"]
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