web_sys/features/
gen_GpuComputePassDescriptor.rs

1#![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 (extends = :: js_sys :: Object , js_name = GPUComputePassDescriptor)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `GpuComputePassDescriptor` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`*"]
13    #[doc = ""]
14    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type GpuComputePassDescriptor;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `label` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`*"]
21    #[doc = ""]
22    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
24    #[wasm_bindgen(method, getter = "label")]
25    pub fn get_label(this: &GpuComputePassDescriptor) -> Option<::alloc::string::String>;
26    #[cfg(web_sys_unstable_apis)]
27    #[doc = "Change the `label` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
33    #[wasm_bindgen(method, setter = "label")]
34    pub fn set_label(this: &GpuComputePassDescriptor, val: &str);
35    #[cfg(web_sys_unstable_apis)]
36    #[cfg(feature = "GpuComputePassTimestampWrites")]
37    #[doc = "Get the `timestampWrites` field of this object."]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`, `GpuComputePassTimestampWrites`*"]
40    #[doc = ""]
41    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
42    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
43    #[wasm_bindgen(method, getter = "timestampWrites")]
44    pub fn get_timestamp_writes(
45        this: &GpuComputePassDescriptor,
46    ) -> Option<GpuComputePassTimestampWrites>;
47    #[cfg(web_sys_unstable_apis)]
48    #[cfg(feature = "GpuComputePassTimestampWrites")]
49    #[doc = "Change the `timestampWrites` field of this object."]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`, `GpuComputePassTimestampWrites`*"]
52    #[doc = ""]
53    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
54    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
55    #[wasm_bindgen(method, setter = "timestampWrites")]
56    pub fn set_timestamp_writes(
57        this: &GpuComputePassDescriptor,
58        val: &GpuComputePassTimestampWrites,
59    );
60}
61#[cfg(web_sys_unstable_apis)]
62impl GpuComputePassDescriptor {
63    #[doc = "Construct a new `GpuComputePassDescriptor`."]
64    #[doc = ""]
65    #[doc = "*This API requires the following crate features to be activated: `GpuComputePassDescriptor`*"]
66    #[doc = ""]
67    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
68    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
69    pub fn new() -> Self {
70        #[allow(unused_mut)]
71        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
72        ret
73    }
74    #[cfg(web_sys_unstable_apis)]
75    #[deprecated = "Use `set_label()` instead."]
76    pub fn label(&mut self, val: &str) -> &mut Self {
77        self.set_label(val);
78        self
79    }
80    #[cfg(web_sys_unstable_apis)]
81    #[cfg(feature = "GpuComputePassTimestampWrites")]
82    #[deprecated = "Use `set_timestamp_writes()` instead."]
83    pub fn timestamp_writes(&mut self, val: &GpuComputePassTimestampWrites) -> &mut Self {
84        self.set_timestamp_writes(val);
85        self
86    }
87}
88#[cfg(web_sys_unstable_apis)]
89impl Default for GpuComputePassDescriptor {
90    fn default() -> Self {
91        Self::new()
92    }
93}