Skip to main content

web_sys/features/
gen_GpuBindGroupEntry.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 = GPUBindGroupEntry)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `GpuBindGroupEntry` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
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 GpuBindGroupEntry;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `binding` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
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 = "binding")]
25    pub fn get_binding(this: &GpuBindGroupEntry) -> u32;
26    #[cfg(web_sys_unstable_apis)]
27    #[doc = "Change the `binding` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
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 = "binding")]
34    pub fn set_binding(this: &GpuBindGroupEntry, val: u32);
35    #[cfg(web_sys_unstable_apis)]
36    #[doc = "Get the `resource` field of this object."]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
42    #[wasm_bindgen(method, getter = "resource")]
43    pub fn get_resource(this: &GpuBindGroupEntry) -> ::wasm_bindgen::JsValue;
44    #[cfg(web_sys_unstable_apis)]
45    #[cfg(feature = "GpuSampler")]
46    #[doc = "Change the `resource` field of this object."]
47    #[doc = ""]
48    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
49    #[doc = ""]
50    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
51    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
52    #[wasm_bindgen(method, setter = "resource")]
53    pub fn set_resource(this: &GpuBindGroupEntry, val: &GpuSampler);
54    #[cfg(web_sys_unstable_apis)]
55    #[cfg(feature = "GpuTexture")]
56    #[doc = "Change the `resource` field of this object."]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
59    #[doc = ""]
60    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
61    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
62    #[wasm_bindgen(method, setter = "resource")]
63    pub fn set_resource_gpu_texture(this: &GpuBindGroupEntry, val: &GpuTexture);
64    #[cfg(web_sys_unstable_apis)]
65    #[cfg(feature = "GpuTextureView")]
66    #[doc = "Change the `resource` field of this object."]
67    #[doc = ""]
68    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
69    #[doc = ""]
70    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
71    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
72    #[wasm_bindgen(method, setter = "resource")]
73    pub fn set_resource_gpu_texture_view(this: &GpuBindGroupEntry, val: &GpuTextureView);
74    #[cfg(web_sys_unstable_apis)]
75    #[cfg(feature = "GpuBuffer")]
76    #[doc = "Change the `resource` field of this object."]
77    #[doc = ""]
78    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
79    #[doc = ""]
80    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
81    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
82    #[wasm_bindgen(method, setter = "resource")]
83    pub fn set_resource_gpu_buffer(this: &GpuBindGroupEntry, val: &GpuBuffer);
84    #[cfg(web_sys_unstable_apis)]
85    #[cfg(feature = "GpuBufferBinding")]
86    #[doc = "Change the `resource` field of this object."]
87    #[doc = ""]
88    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
89    #[doc = ""]
90    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
91    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
92    #[wasm_bindgen(method, setter = "resource")]
93    pub fn set_resource_gpu_buffer_binding(this: &GpuBindGroupEntry, val: &GpuBufferBinding);
94    #[cfg(web_sys_unstable_apis)]
95    #[cfg(feature = "GpuExternalTexture")]
96    #[doc = "Change the `resource` field of this object."]
97    #[doc = ""]
98    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`*"]
99    #[doc = ""]
100    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
101    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
102    #[wasm_bindgen(method, setter = "resource")]
103    pub fn set_resource_gpu_external_texture(this: &GpuBindGroupEntry, val: &GpuExternalTexture);
104}
105#[cfg(web_sys_unstable_apis)]
106impl GpuBindGroupEntry {
107    #[cfg(feature = "GpuSampler")]
108    #[doc = "Construct a new `GpuBindGroupEntry`."]
109    #[doc = ""]
110    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuSampler`*"]
111    #[doc = ""]
112    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
113    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
114    pub fn new(binding: u32, resource: &GpuSampler) -> Self {
115        #[allow(unused_mut)]
116        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
117        ret.set_binding(binding);
118        ret.set_resource(resource);
119        ret
120    }
121    #[cfg(feature = "GpuTexture")]
122    #[doc = "Construct a new `GpuBindGroupEntry`."]
123    #[doc = ""]
124    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuTexture`*"]
125    #[doc = ""]
126    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
127    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
128    pub fn new_with_gpu_texture(binding: u32, resource: &GpuTexture) -> Self {
129        #[allow(unused_mut)]
130        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
131        ret.set_binding(binding);
132        ret.set_resource_gpu_texture(resource);
133        ret
134    }
135    #[cfg(feature = "GpuTextureView")]
136    #[doc = "Construct a new `GpuBindGroupEntry`."]
137    #[doc = ""]
138    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuTextureView`*"]
139    #[doc = ""]
140    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
141    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
142    pub fn new_with_gpu_texture_view(binding: u32, resource: &GpuTextureView) -> Self {
143        #[allow(unused_mut)]
144        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
145        ret.set_binding(binding);
146        ret.set_resource_gpu_texture_view(resource);
147        ret
148    }
149    #[cfg(feature = "GpuBuffer")]
150    #[doc = "Construct a new `GpuBindGroupEntry`."]
151    #[doc = ""]
152    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuBuffer`*"]
153    #[doc = ""]
154    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
155    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
156    pub fn new_with_gpu_buffer(binding: u32, resource: &GpuBuffer) -> Self {
157        #[allow(unused_mut)]
158        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
159        ret.set_binding(binding);
160        ret.set_resource_gpu_buffer(resource);
161        ret
162    }
163    #[cfg(feature = "GpuBufferBinding")]
164    #[doc = "Construct a new `GpuBindGroupEntry`."]
165    #[doc = ""]
166    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuBufferBinding`*"]
167    #[doc = ""]
168    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
169    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
170    pub fn new_with_gpu_buffer_binding(binding: u32, resource: &GpuBufferBinding) -> Self {
171        #[allow(unused_mut)]
172        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
173        ret.set_binding(binding);
174        ret.set_resource_gpu_buffer_binding(resource);
175        ret
176    }
177    #[cfg(feature = "GpuExternalTexture")]
178    #[doc = "Construct a new `GpuBindGroupEntry`."]
179    #[doc = ""]
180    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupEntry`, `GpuExternalTexture`*"]
181    #[doc = ""]
182    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
183    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
184    pub fn new_with_gpu_external_texture(binding: u32, resource: &GpuExternalTexture) -> Self {
185        #[allow(unused_mut)]
186        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
187        ret.set_binding(binding);
188        ret.set_resource_gpu_external_texture(resource);
189        ret
190    }
191    #[cfg(web_sys_unstable_apis)]
192    #[deprecated = "Use `set_binding()` instead."]
193    pub fn binding(&mut self, val: u32) -> &mut Self {
194        self.set_binding(val);
195        self
196    }
197    #[cfg(web_sys_unstable_apis)]
198    #[deprecated = "Use `set_resource()` instead."]
199    pub fn resource(&mut self, val: &GpuSampler) -> &mut Self {
200        self.set_resource(val);
201        self
202    }
203}