maxcountryman_web_sys/features/
gen_GpuBindGroupLayoutEntry.rs

1#![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 = GPUBindGroupLayoutEntry)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `GpuBindGroupLayoutEntry` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"]
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 GpuBindGroupLayoutEntry;
16}
17#[cfg(web_sys_unstable_apis)]
18impl GpuBindGroupLayoutEntry {
19    #[doc = "Construct a new `GpuBindGroupLayoutEntry`."]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"]
22    #[doc = ""]
23    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
24    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
25    pub fn new(binding: u32, visibility: u32) -> Self {
26        #[allow(unused_mut)]
27        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
28        ret.binding(binding);
29        ret.visibility(visibility);
30        ret
31    }
32    #[cfg(web_sys_unstable_apis)]
33    #[doc = "Change the `binding` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"]
36    #[doc = ""]
37    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
38    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
39    pub fn binding(&mut self, val: u32) -> &mut Self {
40        use wasm_bindgen::JsValue;
41        let r = ::js_sys::Reflect::set(
42            self.as_ref(),
43            &JsValue::from("binding"),
44            &JsValue::from(val),
45        );
46        debug_assert!(
47            r.is_ok(),
48            "setting properties should never fail on our dictionary objects"
49        );
50        let _ = r;
51        self
52    }
53    #[cfg(web_sys_unstable_apis)]
54    #[cfg(feature = "GpuBufferBindingLayout")]
55    #[doc = "Change the `buffer` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuBufferBindingLayout`*"]
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    pub fn buffer(&mut self, val: &GpuBufferBindingLayout) -> &mut Self {
62        use wasm_bindgen::JsValue;
63        let r =
64            ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("buffer"), &JsValue::from(val));
65        debug_assert!(
66            r.is_ok(),
67            "setting properties should never fail on our dictionary objects"
68        );
69        let _ = r;
70        self
71    }
72    #[cfg(web_sys_unstable_apis)]
73    #[cfg(feature = "GpuExternalTextureBindingLayout")]
74    #[doc = "Change the `externalTexture` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuExternalTextureBindingLayout`*"]
77    #[doc = ""]
78    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
79    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
80    pub fn external_texture(&mut self, val: &GpuExternalTextureBindingLayout) -> &mut Self {
81        use wasm_bindgen::JsValue;
82        let r = ::js_sys::Reflect::set(
83            self.as_ref(),
84            &JsValue::from("externalTexture"),
85            &JsValue::from(val),
86        );
87        debug_assert!(
88            r.is_ok(),
89            "setting properties should never fail on our dictionary objects"
90        );
91        let _ = r;
92        self
93    }
94    #[cfg(web_sys_unstable_apis)]
95    #[cfg(feature = "GpuSamplerBindingLayout")]
96    #[doc = "Change the `sampler` field of this object."]
97    #[doc = ""]
98    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuSamplerBindingLayout`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
102    pub fn sampler(&mut self, val: &GpuSamplerBindingLayout) -> &mut Self {
103        use wasm_bindgen::JsValue;
104        let r = ::js_sys::Reflect::set(
105            self.as_ref(),
106            &JsValue::from("sampler"),
107            &JsValue::from(val),
108        );
109        debug_assert!(
110            r.is_ok(),
111            "setting properties should never fail on our dictionary objects"
112        );
113        let _ = r;
114        self
115    }
116    #[cfg(web_sys_unstable_apis)]
117    #[cfg(feature = "GpuStorageTextureBindingLayout")]
118    #[doc = "Change the `storageTexture` field of this object."]
119    #[doc = ""]
120    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuStorageTextureBindingLayout`*"]
121    #[doc = ""]
122    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
123    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
124    pub fn storage_texture(&mut self, val: &GpuStorageTextureBindingLayout) -> &mut Self {
125        use wasm_bindgen::JsValue;
126        let r = ::js_sys::Reflect::set(
127            self.as_ref(),
128            &JsValue::from("storageTexture"),
129            &JsValue::from(val),
130        );
131        debug_assert!(
132            r.is_ok(),
133            "setting properties should never fail on our dictionary objects"
134        );
135        let _ = r;
136        self
137    }
138    #[cfg(web_sys_unstable_apis)]
139    #[cfg(feature = "GpuTextureBindingLayout")]
140    #[doc = "Change the `texture` field of this object."]
141    #[doc = ""]
142    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`, `GpuTextureBindingLayout`*"]
143    #[doc = ""]
144    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
145    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
146    pub fn texture(&mut self, val: &GpuTextureBindingLayout) -> &mut Self {
147        use wasm_bindgen::JsValue;
148        let r = ::js_sys::Reflect::set(
149            self.as_ref(),
150            &JsValue::from("texture"),
151            &JsValue::from(val),
152        );
153        debug_assert!(
154            r.is_ok(),
155            "setting properties should never fail on our dictionary objects"
156        );
157        let _ = r;
158        self
159    }
160    #[cfg(web_sys_unstable_apis)]
161    #[doc = "Change the `visibility` field of this object."]
162    #[doc = ""]
163    #[doc = "*This API requires the following crate features to be activated: `GpuBindGroupLayoutEntry`*"]
164    #[doc = ""]
165    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
166    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
167    pub fn visibility(&mut self, val: u32) -> &mut Self {
168        use wasm_bindgen::JsValue;
169        let r = ::js_sys::Reflect::set(
170            self.as_ref(),
171            &JsValue::from("visibility"),
172            &JsValue::from(val),
173        );
174        debug_assert!(
175            r.is_ok(),
176            "setting properties should never fail on our dictionary objects"
177        );
178        let _ = r;
179        self
180    }
181}