web_sys/features/
gen_GpuQuerySetDescriptor.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 = GPUQuerySetDescriptor)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `GpuQuerySetDescriptor` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`*"]
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 GpuQuerySetDescriptor;
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: `GpuQuerySetDescriptor`*"]
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: &GpuQuerySetDescriptor) -> 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: `GpuQuerySetDescriptor`*"]
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: &GpuQuerySetDescriptor, val: &str);
35    #[cfg(web_sys_unstable_apis)]
36    #[doc = "Get the `count` field of this object."]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`*"]
39    #[doc = ""]
40    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
41    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
42    #[wasm_bindgen(method, getter = "count")]
43    pub fn get_count(this: &GpuQuerySetDescriptor) -> u32;
44    #[cfg(web_sys_unstable_apis)]
45    #[doc = "Change the `count` field of this object."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`*"]
48    #[doc = ""]
49    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
50    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
51    #[wasm_bindgen(method, setter = "count")]
52    pub fn set_count(this: &GpuQuerySetDescriptor, val: u32);
53    #[cfg(web_sys_unstable_apis)]
54    #[cfg(feature = "GpuQueryType")]
55    #[doc = "Get the `type` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`, `GpuQueryType`*"]
58    #[doc = ""]
59    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
60    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
61    #[wasm_bindgen(method, getter = "type")]
62    pub fn get_type(this: &GpuQuerySetDescriptor) -> GpuQueryType;
63    #[cfg(web_sys_unstable_apis)]
64    #[cfg(feature = "GpuQueryType")]
65    #[doc = "Change the `type` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`, `GpuQueryType`*"]
68    #[doc = ""]
69    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
70    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
71    #[wasm_bindgen(method, setter = "type")]
72    pub fn set_type(this: &GpuQuerySetDescriptor, val: GpuQueryType);
73}
74#[cfg(web_sys_unstable_apis)]
75impl GpuQuerySetDescriptor {
76    #[cfg(feature = "GpuQueryType")]
77    #[doc = "Construct a new `GpuQuerySetDescriptor`."]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`, `GpuQueryType`*"]
80    #[doc = ""]
81    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
82    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
83    pub fn new(count: u32, type_: GpuQueryType) -> Self {
84        #[allow(unused_mut)]
85        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
86        ret.set_count(count);
87        ret.set_type(type_);
88        ret
89    }
90    #[cfg(web_sys_unstable_apis)]
91    #[deprecated = "Use `set_label()` instead."]
92    pub fn label(&mut self, val: &str) -> &mut Self {
93        self.set_label(val);
94        self
95    }
96    #[cfg(web_sys_unstable_apis)]
97    #[deprecated = "Use `set_count()` instead."]
98    pub fn count(&mut self, val: u32) -> &mut Self {
99        self.set_count(val);
100        self
101    }
102    #[cfg(web_sys_unstable_apis)]
103    #[cfg(feature = "GpuQueryType")]
104    #[deprecated = "Use `set_type()` instead."]
105    pub fn type_(&mut self, val: GpuQueryType) -> &mut Self {
106        self.set_type(val);
107        self
108    }
109}