Skip to content

Commit 70b49c5

Browse files
authored
RUST-1635 Document WASM support (#413)
1 parent 3cc6dd3 commit 70b49c5

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Encoding and decoding support for BSON in Rust
1919
- [Modeling BSON with strongly typed data structures](#modeling-bson-with-strongly-typed-data-structures)
2020
- [Working with datetimes](#working-with-datetimes)
2121
- [Working with UUIDs](#working-with-uuids)
22+
- [WASM support](#wasm-support)
2223
- [Contributing](#contributing)
2324
- [Running the Tests](#running-the-tests)
2425
- [Continuous Integration](#continuous-integration)
@@ -250,6 +251,10 @@ let query = doc! {
250251

251252
See the module-level documentation for the [`bson::uuid` module](https://docs.rs/bson/latest/bson/uuid).
252253

254+
### WASM support
255+
256+
This crate compiles to the `wasm32-unknown-unknown` target; when doing so, the `js-sys` crate is used for the current timestamp component of `ObjectId` generation.
257+
253258
## Minimum supported Rust version (MSRV)
254259

255260
The MSRV for this crate is currently 1.48.0. This will be rarely be increased, and if it ever is,

src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@
260260
//!
261261
//! See the module level documentation for the [`uuid`] module.
262262
//!
263+
//! ## WASM support
264+
//!
265+
//! This crate compiles to the `wasm32-unknown-unknown` target; when doing so, the `js-sys` crate is
266+
//! used for the current timestamp component of `ObjectId` generation.
267+
//!
263268
//! ## Minimum supported Rust version (MSRV)
264269
//!
265270
//! The MSRV for this crate is currently 1.56.0. This will be rarely be increased, and if it ever is,
@@ -271,9 +276,9 @@
271276

272277
#[doc(inline)]
273278
pub use self::{
279+
binary::Binary,
274280
bson::{Array, Bson, DbPointer, Document, JavaScriptCodeWithScope, Regex, Timestamp},
275281
datetime::DateTime,
276-
binary::Binary,
277282
de::{
278283
from_bson, from_bson_with_options, from_document, from_document_with_options, from_reader,
279284
from_reader_utf8_lossy, from_slice, from_slice_utf8_lossy, Deserializer,
@@ -293,8 +298,8 @@ pub use self::{
293298

294299
#[macro_use]
295300
mod macros;
296-
mod bson;
297301
pub mod binary;
302+
mod bson;
298303
pub mod datetime;
299304
pub mod de;
300305
pub mod decimal128;

0 commit comments

Comments
 (0)