Skip to content

Commit 1291c00

Browse files
Document all features of wasm-bindgen (#4342)
1 parent 0c06e1a commit 1291c00

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ std = ["wasm-bindgen-macro/std", "once_cell/std"]
3232
# all unused attributes
3333
strict-macro = ["wasm-bindgen-macro/strict-macro"]
3434

35-
# Enables gg-alloc as system allocator when using wasm-bindgen-test to check that large pointers
35+
# INTERNAL ONLY: Enables gg-alloc as system allocator when using wasm-bindgen-test to check that large pointers
3636
# are handled correctly
3737
gg-alloc = ["wasm-bindgen-test/gg-alloc"]
3838

39-
# This is only for debugging wasm-bindgen! No stability guarantees, so enable
39+
# INTERNAL ONLY: This is only for debugging wasm-bindgen! No stability guarantees, so enable
4040
# this at your own peril!
4141
xxx_debug_only_print_generated_code = ["wasm-bindgen-macro/xxx_debug_only_print_generated_code"]
4242

src/lib.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,39 @@
44
//! attribute and tool. Crates pull in the `#[wasm_bindgen]` attribute through
55
//! this crate and this crate also provides JS bindings through the `JsValue`
66
//! interface.
7+
//!
8+
//! ## Features
9+
//!
10+
//! ### `enable-interning`
11+
//!
12+
//! Enables the internal cache for [`wasm_bindgen::intern`].
13+
//!
14+
//! This feature currently enables the `std` feature, meaning that it is not
15+
//! compatible with `no_std` environments.
16+
//!
17+
//! ### `std` (default)
18+
//!
19+
//! Enabling this feature will make the crate depend on the Rust standard library.
20+
//!
21+
//! Disable this feature to use this crate in `no_std` environments.
22+
//!
23+
//! ### `strict-macro`
24+
//!
25+
//! All warnings the `#[wasm_bindgen]` macro emits are turned into hard errors.
26+
//! This mainly affects unused attribute options.
27+
//!
28+
//! ### Deprecated features
29+
//!
30+
//! #### `serde-serialize`
31+
//!
32+
//! **Deprecated:** Use the [`serde-wasm-bindgen`](https://docs.rs/serde-wasm-bindgen/latest/serde_wasm_bindgen/) crate instead.
33+
//!
34+
//! Enables the `JsValue::from_serde` and `JsValue::into_serde` methods for
35+
//! serializing and deserializing Rust types to and from JavaScript.
36+
//!
37+
//! #### `spans`
38+
//!
39+
//! **Deprecated:** This feature became a no-op in wasm-bindgen v0.2.20 (Sep 7, 2018).
740
841
#![no_std]
942
#![cfg_attr(wasm_bindgen_unstable_test_coverage, feature(coverage_attribute))]

0 commit comments

Comments
 (0)