Debian Codegraph @

.cargo/vendor/wasm-bindgen/guide/src/web-sys/cargo-features.md

raw
1 # Cargo Features in `web-sys`
2
3 To keep `web-sys` building as fast as possible, there is a cargo feature for
4 every type defined in `web-sys`. To access that type, you must enable its
5 feature. To access a method, you must enable the feature for its `self` type and
6 the features for each of its argument types. In the [API documentation][], every
7 method lists the features that are required to enable it.
8
9 For example, [the `WebGlRenderingContext::compile_shader` function][compile_shader] requires these features:
10
11 * `WebGlRenderingContext`, because that is the method's `self` type
12 * `WebGlShader`, because it takes an argument of that type
13
14 [API documentation]: https://rustwasm.github.io/wasm-bindgen/api/web_sys
15 [compile_shader]: https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.WebGlRenderingContext.html#method.compile_shader