maxcountryman_web_sys/features/
gen_GpuStorageTextureBindingLayout.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 = GPUStorageTextureBindingLayout)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `GpuStorageTextureBindingLayout` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`*"]
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 GpuStorageTextureBindingLayout;
16}
17#[cfg(web_sys_unstable_apis)]
18impl GpuStorageTextureBindingLayout {
19    #[cfg(feature = "GpuTextureFormat")]
20    #[doc = "Construct a new `GpuStorageTextureBindingLayout`."]
21    #[doc = ""]
22    #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`, `GpuTextureFormat`*"]
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(format: GpuTextureFormat) -> Self {
27        #[allow(unused_mut)]
28        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
29        ret.format(format);
30        ret
31    }
32    #[cfg(web_sys_unstable_apis)]
33    #[cfg(feature = "GpuStorageTextureAccess")]
34    #[doc = "Change the `access` field of this object."]
35    #[doc = ""]
36    #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureAccess`, `GpuStorageTextureBindingLayout`*"]
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 access(&mut self, val: GpuStorageTextureAccess) -> &mut Self {
41        use wasm_bindgen::JsValue;
42        let r =
43            ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("access"), &JsValue::from(val));
44        debug_assert!(
45            r.is_ok(),
46            "setting properties should never fail on our dictionary objects"
47        );
48        let _ = r;
49        self
50    }
51    #[cfg(web_sys_unstable_apis)]
52    #[cfg(feature = "GpuTextureFormat")]
53    #[doc = "Change the `format` field of this object."]
54    #[doc = ""]
55    #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`, `GpuTextureFormat`*"]
56    #[doc = ""]
57    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
58    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
59    pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self {
60        use wasm_bindgen::JsValue;
61        let r =
62            ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val));
63        debug_assert!(
64            r.is_ok(),
65            "setting properties should never fail on our dictionary objects"
66        );
67        let _ = r;
68        self
69    }
70    #[cfg(web_sys_unstable_apis)]
71    #[cfg(feature = "GpuTextureViewDimension")]
72    #[doc = "Change the `viewDimension` field of this object."]
73    #[doc = ""]
74    #[doc = "*This API requires the following crate features to be activated: `GpuStorageTextureBindingLayout`, `GpuTextureViewDimension`*"]
75    #[doc = ""]
76    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
77    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
78    pub fn view_dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self {
79        use wasm_bindgen::JsValue;
80        let r = ::js_sys::Reflect::set(
81            self.as_ref(),
82            &JsValue::from("viewDimension"),
83            &JsValue::from(val),
84        );
85        debug_assert!(
86            r.is_ok(),
87            "setting properties should never fail on our dictionary objects"
88        );
89        let _ = r;
90        self
91    }
92}