Skip to main content

web_sys/features/
gen_GpuRenderBundleEncoderDescriptor.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(
9        extends = "::js_sys::Object",
10        js_name = "GPURenderBundleEncoderDescriptor"
11    )]
12    #[derive(Debug, Clone, PartialEq, Eq)]
13    #[doc = "The `GpuRenderBundleEncoderDescriptor` dictionary."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"]
16    #[doc = ""]
17    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
18    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
19    pub type GpuRenderBundleEncoderDescriptor;
20    #[cfg(web_sys_unstable_apis)]
21    #[doc = "Get the `label` field of this object."]
22    #[doc = ""]
23    #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"]
24    #[doc = ""]
25    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
26    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
27    #[wasm_bindgen(method, getter = "label")]
28    pub fn get_label(this: &GpuRenderBundleEncoderDescriptor) -> Option<::alloc::string::String>;
29    #[cfg(web_sys_unstable_apis)]
30    #[doc = "Change the `label` field of this object."]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"]
33    #[doc = ""]
34    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
35    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
36    #[wasm_bindgen(method, setter = "label")]
37    pub fn set_label(this: &GpuRenderBundleEncoderDescriptor, val: &str);
38    #[cfg(web_sys_unstable_apis)]
39    #[doc = "Get the `colorFormats` field of this object."]
40    #[doc = ""]
41    #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"]
42    #[doc = ""]
43    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
44    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
45    #[wasm_bindgen(method, getter = "colorFormats")]
46    pub fn get_color_formats(
47        this: &GpuRenderBundleEncoderDescriptor,
48    ) -> ::js_sys::Array<::js_sys::JsOption<::js_sys::JsString>>;
49    #[cfg(web_sys_unstable_apis)]
50    #[doc = "Change the `colorFormats` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"]
53    #[doc = ""]
54    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
55    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
56    #[wasm_bindgen(method, setter = "colorFormats")]
57    pub fn set_color_formats(
58        this: &GpuRenderBundleEncoderDescriptor,
59        val: &[::js_sys::JsOption<::js_sys::JsString>],
60    );
61    #[cfg(web_sys_unstable_apis)]
62    #[cfg(feature = "GpuTextureFormat")]
63    #[doc = "Get the `depthStencilFormat` field of this object."]
64    #[doc = ""]
65    #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`, `GpuTextureFormat`*"]
66    #[doc = ""]
67    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
68    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
69    #[wasm_bindgen(method, getter = "depthStencilFormat")]
70    pub fn get_depth_stencil_format(
71        this: &GpuRenderBundleEncoderDescriptor,
72    ) -> Option<GpuTextureFormat>;
73    #[cfg(web_sys_unstable_apis)]
74    #[cfg(feature = "GpuTextureFormat")]
75    #[doc = "Change the `depthStencilFormat` field of this object."]
76    #[doc = ""]
77    #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`, `GpuTextureFormat`*"]
78    #[doc = ""]
79    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
80    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
81    #[wasm_bindgen(method, setter = "depthStencilFormat")]
82    pub fn set_depth_stencil_format(this: &GpuRenderBundleEncoderDescriptor, val: GpuTextureFormat);
83    #[cfg(web_sys_unstable_apis)]
84    #[doc = "Get the `sampleCount` field of this object."]
85    #[doc = ""]
86    #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"]
87    #[doc = ""]
88    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
89    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
90    #[wasm_bindgen(method, getter = "sampleCount")]
91    pub fn get_sample_count(this: &GpuRenderBundleEncoderDescriptor) -> Option<u32>;
92    #[cfg(web_sys_unstable_apis)]
93    #[doc = "Change the `sampleCount` field of this object."]
94    #[doc = ""]
95    #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"]
96    #[doc = ""]
97    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
98    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
99    #[wasm_bindgen(method, setter = "sampleCount")]
100    pub fn set_sample_count(this: &GpuRenderBundleEncoderDescriptor, val: u32);
101    #[cfg(web_sys_unstable_apis)]
102    #[doc = "Get the `depthReadOnly` field of this object."]
103    #[doc = ""]
104    #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"]
105    #[doc = ""]
106    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
107    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
108    #[wasm_bindgen(method, getter = "depthReadOnly")]
109    pub fn get_depth_read_only(this: &GpuRenderBundleEncoderDescriptor) -> Option<bool>;
110    #[cfg(web_sys_unstable_apis)]
111    #[doc = "Change the `depthReadOnly` field of this object."]
112    #[doc = ""]
113    #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"]
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, setter = "depthReadOnly")]
118    pub fn set_depth_read_only(this: &GpuRenderBundleEncoderDescriptor, val: bool);
119    #[cfg(web_sys_unstable_apis)]
120    #[doc = "Get the `stencilReadOnly` field of this object."]
121    #[doc = ""]
122    #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"]
123    #[doc = ""]
124    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
125    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
126    #[wasm_bindgen(method, getter = "stencilReadOnly")]
127    pub fn get_stencil_read_only(this: &GpuRenderBundleEncoderDescriptor) -> Option<bool>;
128    #[cfg(web_sys_unstable_apis)]
129    #[doc = "Change the `stencilReadOnly` field of this object."]
130    #[doc = ""]
131    #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"]
132    #[doc = ""]
133    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
134    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
135    #[wasm_bindgen(method, setter = "stencilReadOnly")]
136    pub fn set_stencil_read_only(this: &GpuRenderBundleEncoderDescriptor, val: bool);
137}
138#[cfg(web_sys_unstable_apis)]
139impl GpuRenderBundleEncoderDescriptor {
140    #[doc = "Construct a new `GpuRenderBundleEncoderDescriptor`."]
141    #[doc = ""]
142    #[doc = "*This API requires the following crate features to be activated: `GpuRenderBundleEncoderDescriptor`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
146    pub fn new(color_formats: &[::js_sys::JsOption<::js_sys::JsString>]) -> Self {
147        #[allow(unused_mut)]
148        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
149        ret.set_color_formats(color_formats);
150        ret
151    }
152    #[cfg(web_sys_unstable_apis)]
153    #[deprecated = "Use `set_label()` instead."]
154    pub fn label(&mut self, val: &str) -> &mut Self {
155        self.set_label(val);
156        self
157    }
158    #[cfg(web_sys_unstable_apis)]
159    #[deprecated = "Use `set_color_formats()` instead."]
160    pub fn color_formats(&mut self, val: &[::js_sys::JsOption<::js_sys::JsString>]) -> &mut Self {
161        self.set_color_formats(val);
162        self
163    }
164    #[cfg(web_sys_unstable_apis)]
165    #[cfg(feature = "GpuTextureFormat")]
166    #[deprecated = "Use `set_depth_stencil_format()` instead."]
167    pub fn depth_stencil_format(&mut self, val: GpuTextureFormat) -> &mut Self {
168        self.set_depth_stencil_format(val);
169        self
170    }
171    #[cfg(web_sys_unstable_apis)]
172    #[deprecated = "Use `set_sample_count()` instead."]
173    pub fn sample_count(&mut self, val: u32) -> &mut Self {
174        self.set_sample_count(val);
175        self
176    }
177    #[cfg(web_sys_unstable_apis)]
178    #[deprecated = "Use `set_depth_read_only()` instead."]
179    pub fn depth_read_only(&mut self, val: bool) -> &mut Self {
180        self.set_depth_read_only(val);
181        self
182    }
183    #[cfg(web_sys_unstable_apis)]
184    #[deprecated = "Use `set_stencil_read_only()` instead."]
185    pub fn stencil_read_only(&mut self, val: bool) -> &mut Self {
186        self.set_stencil_read_only(val);
187        self
188    }
189}