web_sys/features/
gen_GpuTextureViewDescriptor.rs1#![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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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 `swizzle` 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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
174 #[wasm_bindgen(method, getter = "swizzle")]
175 pub fn get_swizzle(this: &GpuTextureViewDescriptor) -> Option<::alloc::string::String>;
176 #[cfg(web_sys_unstable_apis)]
177 #[doc = "Change the `swizzle` 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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
183 #[wasm_bindgen(method, setter = "swizzle")]
184 pub fn set_swizzle(this: &GpuTextureViewDescriptor, val: &str);
185 #[cfg(web_sys_unstable_apis)]
186 #[doc = "Get the `usage` field of this object."]
187 #[doc = ""]
188 #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"]
189 #[doc = ""]
190 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
191 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
192 #[wasm_bindgen(method, getter = "usage")]
193 pub fn get_usage(this: &GpuTextureViewDescriptor) -> Option<u32>;
194 #[cfg(web_sys_unstable_apis)]
195 #[doc = "Change the `usage` field of this object."]
196 #[doc = ""]
197 #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"]
198 #[doc = ""]
199 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
200 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
201 #[wasm_bindgen(method, setter = "usage")]
202 pub fn set_usage(this: &GpuTextureViewDescriptor, val: u32);
203}
204#[cfg(web_sys_unstable_apis)]
205impl GpuTextureViewDescriptor {
206 #[doc = "Construct a new `GpuTextureViewDescriptor`."]
207 #[doc = ""]
208 #[doc = "*This API requires the following crate features to be activated: `GpuTextureViewDescriptor`*"]
209 #[doc = ""]
210 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
211 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
212 pub fn new() -> Self {
213 #[allow(unused_mut)]
214 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
215 ret
216 }
217 #[cfg(web_sys_unstable_apis)]
218 #[deprecated = "Use `set_label()` instead."]
219 pub fn label(&mut self, val: &str) -> &mut Self {
220 self.set_label(val);
221 self
222 }
223 #[cfg(web_sys_unstable_apis)]
224 #[deprecated = "Use `set_array_layer_count()` instead."]
225 pub fn array_layer_count(&mut self, val: u32) -> &mut Self {
226 self.set_array_layer_count(val);
227 self
228 }
229 #[cfg(web_sys_unstable_apis)]
230 #[cfg(feature = "GpuTextureAspect")]
231 #[deprecated = "Use `set_aspect()` instead."]
232 pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self {
233 self.set_aspect(val);
234 self
235 }
236 #[cfg(web_sys_unstable_apis)]
237 #[deprecated = "Use `set_base_array_layer()` instead."]
238 pub fn base_array_layer(&mut self, val: u32) -> &mut Self {
239 self.set_base_array_layer(val);
240 self
241 }
242 #[cfg(web_sys_unstable_apis)]
243 #[deprecated = "Use `set_base_mip_level()` instead."]
244 pub fn base_mip_level(&mut self, val: u32) -> &mut Self {
245 self.set_base_mip_level(val);
246 self
247 }
248 #[cfg(web_sys_unstable_apis)]
249 #[cfg(feature = "GpuTextureViewDimension")]
250 #[deprecated = "Use `set_dimension()` instead."]
251 pub fn dimension(&mut self, val: GpuTextureViewDimension) -> &mut Self {
252 self.set_dimension(val);
253 self
254 }
255 #[cfg(web_sys_unstable_apis)]
256 #[cfg(feature = "GpuTextureFormat")]
257 #[deprecated = "Use `set_format()` instead."]
258 pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self {
259 self.set_format(val);
260 self
261 }
262 #[cfg(web_sys_unstable_apis)]
263 #[deprecated = "Use `set_mip_level_count()` instead."]
264 pub fn mip_level_count(&mut self, val: u32) -> &mut Self {
265 self.set_mip_level_count(val);
266 self
267 }
268 #[cfg(web_sys_unstable_apis)]
269 #[deprecated = "Use `set_swizzle()` instead."]
270 pub fn swizzle(&mut self, val: &str) -> &mut Self {
271 self.set_swizzle(val);
272 self
273 }
274 #[cfg(web_sys_unstable_apis)]
275 #[deprecated = "Use `set_usage()` instead."]
276 pub fn usage(&mut self, val: u32) -> &mut Self {
277 self.set_usage(val);
278 self
279 }
280}
281#[cfg(web_sys_unstable_apis)]
282impl Default for GpuTextureViewDescriptor {
283 fn default() -> Self {
284 Self::new()
285 }
286}