web_sys/features/
gen_GpuTextureViewDescriptor.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 = GPUTextureViewDescriptor)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `GpuTextureViewDescriptor` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type GpuTextureViewDescriptor;
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: `GpuTextureViewDescriptor`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
24    #[wasm_bindgen(method, getter = "label")]
25    pub fn get_label(this: &GpuTextureViewDescriptor) -> 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: `GpuTextureViewDescriptor`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
33    #[wasm_bindgen(method, setter = "label")]
34    pub fn set_label(this: &GpuTextureViewDescriptor, val: &str);
35    #[cfg(web_sys_unstable_apis)]
36    #[doc = "Get the `arrayLayerCount` field of this object."]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
42    #[wasm_bindgen(method, getter = "arrayLayerCount")]
43    pub fn get_array_layer_count(this: &GpuTextureViewDescriptor) -> Option<u32>;
44    #[cfg(web_sys_unstable_apis)]
45    #[doc = "Change the `arrayLayerCount` field of this object."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"]
48    #[doc = ""]
49    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
50    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
51    #[wasm_bindgen(method, setter = "arrayLayerCount")]
52    pub fn set_array_layer_count(this: &GpuTextureViewDescriptor, val: u32);
53    #[cfg(web_sys_unstable_apis)]
54    #[cfg(feature = "GpuTextureAspect")]
55    #[doc = "Get the `aspect` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `GpuTextureAspect`, `GpuTextureViewDescriptor`*"]
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    #[wasm_bindgen(method, getter = "aspect")]
62    pub fn get_aspect(this: &GpuTextureViewDescriptor) -> Option<GpuTextureAspect>;
63    #[cfg(web_sys_unstable_apis)]
64    #[cfg(feature = "GpuTextureAspect")]
65    #[doc = "Change the `aspect` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `GpuTextureAspect`, `GpuTextureViewDescriptor`*"]
68    #[doc = ""]
69    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
70    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
71    #[wasm_bindgen(method, setter = "aspect")]
72    pub fn set_aspect(this: &GpuTextureViewDescriptor, val: GpuTextureAspect);
73    #[cfg(web_sys_unstable_apis)]
74    #[doc = "Get the `baseArrayLayer` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"]
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    #[wasm_bindgen(method, getter = "baseArrayLayer")]
81    pub fn get_base_array_layer(this: &GpuTextureViewDescriptor) -> Option<u32>;
82    #[cfg(web_sys_unstable_apis)]
83    #[doc = "Change the `baseArrayLayer` field of this object."]
84    #[doc = ""]
85    #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"]
86    #[doc = ""]
87    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
88    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
89    #[wasm_bindgen(method, setter = "baseArrayLayer")]
90    pub fn set_base_array_layer(this: &GpuTextureViewDescriptor, val: u32);
91    #[cfg(web_sys_unstable_apis)]
92    #[doc = "Get the `baseMipLevel` field of this object."]
93    #[doc = ""]
94    #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"]
95    #[doc = ""]
96    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
97    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
98    #[wasm_bindgen(method, getter = "baseMipLevel")]
99    pub fn get_base_mip_level(this: &GpuTextureViewDescriptor) -> Option<u32>;
100    #[cfg(web_sys_unstable_apis)]
101    #[doc = "Change the `baseMipLevel` field of this object."]
102    #[doc = ""]
103    #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"]
104    #[doc = ""]
105    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
106    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
107    #[wasm_bindgen(method, setter = "baseMipLevel")]
108    pub fn set_base_mip_level(this: &GpuTextureViewDescriptor, val: u32);
109    #[cfg(web_sys_unstable_apis)]
110    #[cfg(feature = "GpuTextureViewDimension")]
111    #[doc = "Get the `dimension` field of this object."]
112    #[doc = ""]
113    #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`, `GpuTextureViewDimension`*"]
114    #[doc = ""]
115    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
116    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
117    #[wasm_bindgen(method, getter = "dimension")]
118    pub fn get_dimension(this: &GpuTextureViewDescriptor) -> Option<GpuTextureViewDimension>;
119    #[cfg(web_sys_unstable_apis)]
120    #[cfg(feature = "GpuTextureViewDimension")]
121    #[doc = "Change the `dimension` field of this object."]
122    #[doc = ""]
123    #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`, `GpuTextureViewDimension`*"]
124    #[doc = ""]
125    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
126    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
127    #[wasm_bindgen(method, setter = "dimension")]
128    pub fn set_dimension(this: &GpuTextureViewDescriptor, val: GpuTextureViewDimension);
129    #[cfg(web_sys_unstable_apis)]
130    #[cfg(feature = "GpuTextureFormat")]
131    #[doc = "Get the `format` field of this object."]
132    #[doc = ""]
133    #[doc = "*This API requires the following crate features to be activated: `GpuTextureFormat`, `GpuTextureViewDescriptor`*"]
134    #[doc = ""]
135    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
136    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
137    #[wasm_bindgen(method, getter = "format")]
138    pub fn get_format(this: &GpuTextureViewDescriptor) -> Option<GpuTextureFormat>;
139    #[cfg(web_sys_unstable_apis)]
140    #[cfg(feature = "GpuTextureFormat")]
141    #[doc = "Change the `format` field of this object."]
142    #[doc = ""]
143    #[doc = "*This API requires the following crate features to be activated: `GpuTextureFormat`, `GpuTextureViewDescriptor`*"]
144    #[doc = ""]
145    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
146    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
147    #[wasm_bindgen(method, setter = "format")]
148    pub fn set_format(this: &GpuTextureViewDescriptor, val: GpuTextureFormat);
149    #[cfg(web_sys_unstable_apis)]
150    #[doc = "Get the `mipLevelCount` field of this object."]
151    #[doc = ""]
152    #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
156    #[wasm_bindgen(method, getter = "mipLevelCount")]
157    pub fn get_mip_level_count(this: &GpuTextureViewDescriptor) -> Option<u32>;
158    #[cfg(web_sys_unstable_apis)]
159    #[doc = "Change the `mipLevelCount` field of this object."]
160    #[doc = ""]
161    #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"]
162    #[doc = ""]
163    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
164    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
165    #[wasm_bindgen(method, setter = "mipLevelCount")]
166    pub fn set_mip_level_count(this: &GpuTextureViewDescriptor, val: u32);
167    #[cfg(web_sys_unstable_apis)]
168    #[doc = "Get the `usage` field of this object."]
169    #[doc = ""]
170    #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"]
171    #[doc = ""]
172    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
173    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
174    #[wasm_bindgen(method, getter = "usage")]
175    pub fn get_usage(this: &GpuTextureViewDescriptor) -> Option<u32>;
176    #[cfg(web_sys_unstable_apis)]
177    #[doc = "Change the `usage` field of this object."]
178    #[doc = ""]
179    #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"]
180    #[doc = ""]
181    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
182    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
183    #[wasm_bindgen(method, setter = "usage")]
184    pub fn set_usage(this: &GpuTextureViewDescriptor, val: u32);
185}
186#[cfg(web_sys_unstable_apis)]
187impl GpuTextureViewDescriptor {
188    #[doc = "Construct a new `GpuTextureViewDescriptor`."]
189    #[doc = ""]
190    #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"]
191    #[doc = ""]
192    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
193    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
194    pub fn new() -> Self {
195        #[allow(unused_mut)]
196        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
197        ret
198    }
199    #[cfg(web_sys_unstable_apis)]
200    #[deprecated = "Use `set_label()` instead."]
201    pub fn label(&mut self, val: &str) -> &mut Self {
202        self.set_label(val);
203        self
204    }
205    #[cfg(web_sys_unstable_apis)]
206    #[deprecated = "Use `set_array_layer_count()` instead."]
207    pub fn array_layer_count(&mut self, val: u32) -> &mut Self {
208        self.set_array_layer_count(val);
209        self
210    }
211    #[cfg(web_sys_unstable_apis)]
212    #[cfg(feature = "GpuTextureAspect")]
213    #[deprecated = "Use `set_aspect()` instead."]
214    pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self {
215        self.set_aspect(val);
216        self
217    }
218    #[cfg(web_sys_unstable_apis)]
219    #[deprecated = "Use `set_base_array_layer()` instead."]
220    pub fn base_array_layer(&mut self, val: u32) -> &mut Self {
221        self.set_base_array_layer(val);
222        self
223    }
224    #[cfg(web_sys_unstable_apis)]
225    #[deprecated = "Use `set_base_mip_level()` instead."]
226    pub fn base_mip_level(&mut self, val: u32) -> &mut Self {
227        self.set_base_mip_level(val);
228        self
229    }
230    #[cfg(web_sys_unstable_apis)]
231    #[cfg(feature = "GpuTextureViewDimension")]
232    #[deprecated = "Use `set_dimension()` instead."]
233    pub fn dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self {
234        self.set_dimension(val);
235        self
236    }
237    #[cfg(web_sys_unstable_apis)]
238    #[cfg(feature = "GpuTextureFormat")]
239    #[deprecated = "Use `set_format()` instead."]
240    pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self {
241        self.set_format(val);
242        self
243    }
244    #[cfg(web_sys_unstable_apis)]
245    #[deprecated = "Use `set_mip_level_count()` instead."]
246    pub fn mip_level_count(&mut self, val: u32) -> &mut Self {
247        self.set_mip_level_count(val);
248        self
249    }
250    #[cfg(web_sys_unstable_apis)]
251    #[deprecated = "Use `set_usage()` instead."]
252    pub fn usage(&mut self, val: u32) -> &mut Self {
253        self.set_usage(val);
254        self
255    }
256}
257#[cfg(web_sys_unstable_apis)]
258impl Default for GpuTextureViewDescriptor {
259    fn default() -> Self {
260        Self::new()
261    }
262}