1 #![allow(unused_imports)]
2 use super::*;
3 use wasm_bindgen::prelude::*;
4 #[cfg(web_sys_unstable_apis)]
5 #[wasm_bindgen]
6 extern "C" {
7     # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBindGroupDescriptor)]
8     #[derive(Debug, Clone, PartialEq, Eq)]
9     #[doc = "The `GpuBindGroupDescriptor` dictionary."]
10     #[doc = ""]
11     #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`*"]
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 GpuBindGroupDescriptor;
16 }
17 #[cfg(web_sys_unstable_apis)]
18 impl GpuBindGroupDescriptor {
19     #[cfg(feature = "GpuBindGroupLayout")]
20     #[doc = "Construct a new `GpuBindGroupDescriptor`."]
21     #[doc = ""]
22     #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`, `GpuBindGroupLayout`*"]
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)*"]
new(entries: &::wasm_bindgen::JsValue, layout: &GpuBindGroupLayout) -> Self26     pub fn new(entries: &::wasm_bindgen::JsValue, layout: &GpuBindGroupLayout) -> Self {
27         #[allow(unused_mut)]
28         let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
29         ret.entries(entries);
30         ret.layout(layout);
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: `GpuBindGroupDescriptor`*"]
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)*"]
label(&mut self, val: &str) -> &mut Self40     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 `entries` field of this object."]
52     #[doc = ""]
53     #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`*"]
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)*"]
entries(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self57     pub fn entries(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
58         use wasm_bindgen::JsValue;
59         let r = ::js_sys::Reflect::set(
60             self.as_ref(),
61             &JsValue::from("entries"),
62             &JsValue::from(val),
63         );
64         debug_assert!(
65             r.is_ok(),
66             "setting properties should never fail on our dictionary objects"
67         );
68         let _ = r;
69         self
70     }
71     #[cfg(web_sys_unstable_apis)]
72     #[cfg(feature = "GpuBindGroupLayout")]
73     #[doc = "Change the `layout` field of this object."]
74     #[doc = ""]
75     #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupDescriptor`, `GpuBindGroupLayout`*"]
76     #[doc = ""]
77     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
78     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
layout(&mut self, val: &GpuBindGroupLayout) -> &mut Self79     pub fn layout(&mut self, val: &GpuBindGroupLayout) -> &mut Self {
80         use wasm_bindgen::JsValue;
81         let r =
82             ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("layout"), &JsValue::from(val));
83         debug_assert!(
84             r.is_ok(),
85             "setting properties should never fail on our dictionary objects"
86         );
87         let _ = r;
88         self
89     }
90 }
91