web_sys/features/
gen_GpuColorTargetState.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 = GPUColorTargetState)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `GpuColorTargetState` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`*"]
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 GpuColorTargetState;
17    #[cfg(web_sys_unstable_apis)]
18    #[cfg(feature = "GpuBlendState")]
19    #[doc = "Get the `blend` field of this object."]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `GpuBlendState`, `GpuColorTargetState`*"]
22    #[doc = ""]
23    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
24    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
25    #[wasm_bindgen(method, getter = "blend")]
26    pub fn get_blend(this: &GpuColorTargetState) -> Option<GpuBlendState>;
27    #[cfg(web_sys_unstable_apis)]
28    #[cfg(feature = "GpuBlendState")]
29    #[doc = "Change the `blend` field of this object."]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `GpuBlendState`, `GpuColorTargetState`*"]
32    #[doc = ""]
33    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
35    #[wasm_bindgen(method, setter = "blend")]
36    pub fn set_blend(this: &GpuColorTargetState, val: &GpuBlendState);
37    #[cfg(web_sys_unstable_apis)]
38    #[cfg(feature = "GpuTextureFormat")]
39    #[doc = "Get the `format` field of this object."]
40    #[doc = ""]
41    #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuTextureFormat`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
45    #[wasm_bindgen(method, getter = "format")]
46    pub fn get_format(this: &GpuColorTargetState) -> GpuTextureFormat;
47    #[cfg(web_sys_unstable_apis)]
48    #[cfg(feature = "GpuTextureFormat")]
49    #[doc = "Change the `format` field of this object."]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuTextureFormat`*"]
52    #[doc = ""]
53    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
54    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
55    #[wasm_bindgen(method, setter = "format")]
56    pub fn set_format(this: &GpuColorTargetState, val: GpuTextureFormat);
57    #[cfg(web_sys_unstable_apis)]
58    #[doc = "Get the `writeMask` field of this object."]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`*"]
61    #[doc = ""]
62    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
63    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
64    #[wasm_bindgen(method, getter = "writeMask")]
65    pub fn get_write_mask(this: &GpuColorTargetState) -> Option<u32>;
66    #[cfg(web_sys_unstable_apis)]
67    #[doc = "Change the `writeMask` field of this object."]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`*"]
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 = "writeMask")]
74    pub fn set_write_mask(this: &GpuColorTargetState, val: u32);
75}
76#[cfg(web_sys_unstable_apis)]
77impl GpuColorTargetState {
78    #[cfg(feature = "GpuTextureFormat")]
79    #[doc = "Construct a new `GpuColorTargetState`."]
80    #[doc = ""]
81    #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuTextureFormat`*"]
82    #[doc = ""]
83    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
84    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
85    pub fn new(format: GpuTextureFormat) -> Self {
86        #[allow(unused_mut)]
87        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
88        ret.set_format(format);
89        ret
90    }
91    #[cfg(web_sys_unstable_apis)]
92    #[cfg(feature = "GpuBlendState")]
93    #[deprecated = "Use `set_blend()` instead."]
94    pub fn blend(&mut self, val: &GpuBlendState) -> &mut Self {
95        self.set_blend(val);
96        self
97    }
98    #[cfg(web_sys_unstable_apis)]
99    #[cfg(feature = "GpuTextureFormat")]
100    #[deprecated = "Use `set_format()` instead."]
101    pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self {
102        self.set_format(val);
103        self
104    }
105    #[cfg(web_sys_unstable_apis)]
106    #[deprecated = "Use `set_write_mask()` instead."]
107    pub fn write_mask(&mut self, val: u32) -> &mut Self {
108        self.set_write_mask(val);
109        self
110    }
111}