Skip to main content

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