web_sys/features/
gen_GpuCanvasContext.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8 #[wasm_bindgen(
9 extends = "::js_sys::Object",
10 js_name = "GPUCanvasContext",
11 typescript_type = "GPUCanvasContext"
12 )]
13 #[derive(Debug, Clone, PartialEq, Eq)]
14 #[doc = "The `GpuCanvasContext` class."]
15 #[doc = ""]
16 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext)"]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `GpuCanvasContext`*"]
19 #[doc = ""]
20 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
21 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
22 pub type GpuCanvasContext;
23 #[cfg(web_sys_unstable_apis)]
24 #[wasm_bindgen(method, getter, js_class = "GPUCanvasContext", js_name = "canvas")]
25 #[doc = "Getter for the `canvas` field of this object."]
26 #[doc = ""]
27 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/canvas)"]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `GpuCanvasContext`*"]
30 #[doc = ""]
31 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
32 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
33 pub fn canvas(this: &GpuCanvasContext) -> ::js_sys::Object;
34 #[cfg(web_sys_unstable_apis)]
35 #[cfg(feature = "GpuCanvasConfiguration")]
36 #[wasm_bindgen(catch, method, js_class = "GPUCanvasContext")]
37 #[doc = "The `configure()` method."]
38 #[doc = ""]
39 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/configure)"]
40 #[doc = ""]
41 #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuCanvasContext`*"]
42 #[doc = ""]
43 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
44 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
45 pub fn configure(
46 this: &GpuCanvasContext,
47 configuration: &GpuCanvasConfiguration,
48 ) -> Result<(), JsValue>;
49 #[cfg(web_sys_unstable_apis)]
50 #[cfg(feature = "GpuCanvasConfiguration")]
51 #[wasm_bindgen(method, js_class = "GPUCanvasContext", js_name = "getConfiguration")]
52 #[doc = "The `getConfiguration()` method."]
53 #[doc = ""]
54 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/getConfiguration)"]
55 #[doc = ""]
56 #[doc = "*This API requires the following crate features to be activated: `GpuCanvasConfiguration`, `GpuCanvasContext`*"]
57 #[doc = ""]
58 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
59 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
60 pub fn get_configuration(this: &GpuCanvasContext) -> Option<GpuCanvasConfiguration>;
61 #[cfg(web_sys_unstable_apis)]
62 #[cfg(feature = "GpuTexture")]
63 #[wasm_bindgen(
64 catch,
65 method,
66 js_class = "GPUCanvasContext",
67 js_name = "getCurrentTexture"
68 )]
69 #[doc = "The `getCurrentTexture()` method."]
70 #[doc = ""]
71 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/getCurrentTexture)"]
72 #[doc = ""]
73 #[doc = "*This API requires the following crate features to be activated: `GpuCanvasContext`, `GpuTexture`*"]
74 #[doc = ""]
75 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
76 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
77 pub fn get_current_texture(this: &GpuCanvasContext) -> Result<GpuTexture, JsValue>;
78 #[cfg(web_sys_unstable_apis)]
79 #[wasm_bindgen(method, js_class = "GPUCanvasContext")]
80 #[doc = "The `unconfigure()` method."]
81 #[doc = ""]
82 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/unconfigure)"]
83 #[doc = ""]
84 #[doc = "*This API requires the following crate features to be activated: `GpuCanvasContext`*"]
85 #[doc = ""]
86 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
87 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
88 pub fn unconfigure(this: &GpuCanvasContext);
89}