web_sys/features/
gen_GpuTextureDescriptor.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 = GPUTextureDescriptor)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `GpuTextureDescriptor` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"]
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 GpuTextureDescriptor;
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: `GpuTextureDescriptor`*"]
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: &GpuTextureDescriptor) -> 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: `GpuTextureDescriptor`*"]
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: &GpuTextureDescriptor, val: &str);
35    #[cfg(web_sys_unstable_apis)]
36    #[cfg(feature = "GpuTextureDimension")]
37    #[doc = "Get the `dimension` field of this object."]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureDimension`*"]
40    #[doc = ""]
41    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
42    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
43    #[wasm_bindgen(method, getter = "dimension")]
44    pub fn get_dimension(this: &GpuTextureDescriptor) -> Option<GpuTextureDimension>;
45    #[cfg(web_sys_unstable_apis)]
46    #[cfg(feature = "GpuTextureDimension")]
47    #[doc = "Change the `dimension` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureDimension`*"]
50    #[doc = ""]
51    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
53    #[wasm_bindgen(method, setter = "dimension")]
54    pub fn set_dimension(this: &GpuTextureDescriptor, val: GpuTextureDimension);
55    #[cfg(web_sys_unstable_apis)]
56    #[cfg(feature = "GpuTextureFormat")]
57    #[doc = "Get the `format` field of this object."]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureFormat`*"]
60    #[doc = ""]
61    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
62    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
63    #[wasm_bindgen(method, getter = "format")]
64    pub fn get_format(this: &GpuTextureDescriptor) -> GpuTextureFormat;
65    #[cfg(web_sys_unstable_apis)]
66    #[cfg(feature = "GpuTextureFormat")]
67    #[doc = "Change the `format` field of this object."]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureFormat`*"]
70    #[doc = ""]
71    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
72    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
73    #[wasm_bindgen(method, setter = "format")]
74    pub fn set_format(this: &GpuTextureDescriptor, val: GpuTextureFormat);
75    #[cfg(web_sys_unstable_apis)]
76    #[doc = "Get the `mipLevelCount` field of this object."]
77    #[doc = ""]
78    #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
82    #[wasm_bindgen(method, getter = "mipLevelCount")]
83    pub fn get_mip_level_count(this: &GpuTextureDescriptor) -> Option<u32>;
84    #[cfg(web_sys_unstable_apis)]
85    #[doc = "Change the `mipLevelCount` field of this object."]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"]
88    #[doc = ""]
89    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
90    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
91    #[wasm_bindgen(method, setter = "mipLevelCount")]
92    pub fn set_mip_level_count(this: &GpuTextureDescriptor, val: u32);
93    #[cfg(web_sys_unstable_apis)]
94    #[doc = "Get the `sampleCount` field of this object."]
95    #[doc = ""]
96    #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"]
97    #[doc = ""]
98    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
99    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
100    #[wasm_bindgen(method, getter = "sampleCount")]
101    pub fn get_sample_count(this: &GpuTextureDescriptor) -> Option<u32>;
102    #[cfg(web_sys_unstable_apis)]
103    #[doc = "Change the `sampleCount` field of this object."]
104    #[doc = ""]
105    #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"]
106    #[doc = ""]
107    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
108    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
109    #[wasm_bindgen(method, setter = "sampleCount")]
110    pub fn set_sample_count(this: &GpuTextureDescriptor, val: u32);
111    #[cfg(web_sys_unstable_apis)]
112    #[doc = "Get the `size` field of this object."]
113    #[doc = ""]
114    #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"]
115    #[doc = ""]
116    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
117    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
118    #[wasm_bindgen(method, getter = "size")]
119    pub fn get_size(this: &GpuTextureDescriptor) -> ::wasm_bindgen::JsValue;
120    #[cfg(web_sys_unstable_apis)]
121    #[doc = "Change the `size` field of this object."]
122    #[doc = ""]
123    #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"]
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 = "size")]
128    pub fn set_size(this: &GpuTextureDescriptor, val: &::wasm_bindgen::JsValue);
129    #[cfg(web_sys_unstable_apis)]
130    #[doc = "Get the `usage` field of this object."]
131    #[doc = ""]
132    #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"]
133    #[doc = ""]
134    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
135    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
136    #[wasm_bindgen(method, getter = "usage")]
137    pub fn get_usage(this: &GpuTextureDescriptor) -> u32;
138    #[cfg(web_sys_unstable_apis)]
139    #[doc = "Change the `usage` field of this object."]
140    #[doc = ""]
141    #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"]
142    #[doc = ""]
143    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
144    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
145    #[wasm_bindgen(method, setter = "usage")]
146    pub fn set_usage(this: &GpuTextureDescriptor, val: u32);
147    #[cfg(web_sys_unstable_apis)]
148    #[doc = "Get the `viewFormats` field of this object."]
149    #[doc = ""]
150    #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"]
151    #[doc = ""]
152    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
153    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
154    #[wasm_bindgen(method, getter = "viewFormats")]
155    pub fn get_view_formats(this: &GpuTextureDescriptor) -> Option<::js_sys::Array>;
156    #[cfg(web_sys_unstable_apis)]
157    #[doc = "Change the `viewFormats` field of this object."]
158    #[doc = ""]
159    #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`*"]
160    #[doc = ""]
161    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
162    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
163    #[wasm_bindgen(method, setter = "viewFormats")]
164    pub fn set_view_formats(this: &GpuTextureDescriptor, val: &::wasm_bindgen::JsValue);
165}
166#[cfg(web_sys_unstable_apis)]
167impl GpuTextureDescriptor {
168    #[cfg(feature = "GpuTextureFormat")]
169    #[doc = "Construct a new `GpuTextureDescriptor`."]
170    #[doc = ""]
171    #[doc = "*This API requires the following crate features to be activated: `GpuTextureDescriptor`, `GpuTextureFormat`*"]
172    #[doc = ""]
173    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
174    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
175    pub fn new(format: GpuTextureFormat, size: &::wasm_bindgen::JsValue, usage: u32) -> Self {
176        #[allow(unused_mut)]
177        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
178        ret.set_format(format);
179        ret.set_size(size);
180        ret.set_usage(usage);
181        ret
182    }
183    #[cfg(web_sys_unstable_apis)]
184    #[deprecated = "Use `set_label()` instead."]
185    pub fn label(&mut self, val: &str) -> &mut Self {
186        self.set_label(val);
187        self
188    }
189    #[cfg(web_sys_unstable_apis)]
190    #[cfg(feature = "GpuTextureDimension")]
191    #[deprecated = "Use `set_dimension()` instead."]
192    pub fn dimension(&mut self, val: GpuTextureDimension) -> &mut Self {
193        self.set_dimension(val);
194        self
195    }
196    #[cfg(web_sys_unstable_apis)]
197    #[cfg(feature = "GpuTextureFormat")]
198    #[deprecated = "Use `set_format()` instead."]
199    pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self {
200        self.set_format(val);
201        self
202    }
203    #[cfg(web_sys_unstable_apis)]
204    #[deprecated = "Use `set_mip_level_count()` instead."]
205    pub fn mip_level_count(&mut self, val: u32) -> &mut Self {
206        self.set_mip_level_count(val);
207        self
208    }
209    #[cfg(web_sys_unstable_apis)]
210    #[deprecated = "Use `set_sample_count()` instead."]
211    pub fn sample_count(&mut self, val: u32) -> &mut Self {
212        self.set_sample_count(val);
213        self
214    }
215    #[cfg(web_sys_unstable_apis)]
216    #[deprecated = "Use `set_size()` instead."]
217    pub fn size(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
218        self.set_size(val);
219        self
220    }
221    #[cfg(web_sys_unstable_apis)]
222    #[deprecated = "Use `set_usage()` instead."]
223    pub fn usage(&mut self, val: u32) -> &mut Self {
224        self.set_usage(val);
225        self
226    }
227    #[cfg(web_sys_unstable_apis)]
228    #[deprecated = "Use `set_view_formats()` instead."]
229    pub fn view_formats(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
230        self.set_view_formats(val);
231        self
232    }
233}