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