maxcountryman_web_sys/features/
gen_GpuQuerySetDescriptor.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[cfg(web_sys_unstable_apis)]
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUQuerySetDescriptor)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `GpuQuerySetDescriptor` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`*"]
12 #[doc = ""]
13 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
14 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
15 pub type GpuQuerySetDescriptor;
16}
17#[cfg(web_sys_unstable_apis)]
18impl GpuQuerySetDescriptor {
19 #[cfg(feature = "GpuQueryType")]
20 #[doc = "Construct a new `GpuQuerySetDescriptor`."]
21 #[doc = ""]
22 #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`, `GpuQueryType`*"]
23 #[doc = ""]
24 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
25 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
26 pub fn new(count: u32, type_: GpuQueryType) -> Self {
27 #[allow(unused_mut)]
28 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
29 ret.count(count);
30 ret.type_(type_);
31 ret
32 }
33 #[cfg(web_sys_unstable_apis)]
34 #[doc = "Change the `label` field of this object."]
35 #[doc = ""]
36 #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`*"]
37 #[doc = ""]
38 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
39 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
40 pub fn label(&mut self, val: &str) -> &mut Self {
41 use wasm_bindgen::JsValue;
42 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val));
43 debug_assert!(
44 r.is_ok(),
45 "setting properties should never fail on our dictionary objects"
46 );
47 let _ = r;
48 self
49 }
50 #[cfg(web_sys_unstable_apis)]
51 #[doc = "Change the `count` field of this object."]
52 #[doc = ""]
53 #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`*"]
54 #[doc = ""]
55 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
56 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
57 pub fn count(&mut self, val: u32) -> &mut Self {
58 use wasm_bindgen::JsValue;
59 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("count"), &JsValue::from(val));
60 debug_assert!(
61 r.is_ok(),
62 "setting properties should never fail on our dictionary objects"
63 );
64 let _ = r;
65 self
66 }
67 #[cfg(web_sys_unstable_apis)]
68 #[doc = "Change the `pipelineStatistics` field of this object."]
69 #[doc = ""]
70 #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`*"]
71 #[doc = ""]
72 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
73 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
74 pub fn pipeline_statistics(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
75 use wasm_bindgen::JsValue;
76 let r = ::js_sys::Reflect::set(
77 self.as_ref(),
78 &JsValue::from("pipelineStatistics"),
79 &JsValue::from(val),
80 );
81 debug_assert!(
82 r.is_ok(),
83 "setting properties should never fail on our dictionary objects"
84 );
85 let _ = r;
86 self
87 }
88 #[cfg(web_sys_unstable_apis)]
89 #[cfg(feature = "GpuQueryType")]
90 #[doc = "Change the `type` field of this object."]
91 #[doc = ""]
92 #[doc = "*This API requires the following crate features to be activated: `GpuQuerySetDescriptor`, `GpuQueryType`*"]
93 #[doc = ""]
94 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
95 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
96 pub fn type_(&mut self, val: GpuQueryType) -> &mut Self {
97 use wasm_bindgen::JsValue;
98 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val));
99 debug_assert!(
100 r.is_ok(),
101 "setting properties should never fail on our dictionary objects"
102 );
103 let _ = r;
104 self
105 }
106}