1 #![allow(unused_imports)]
2 use super::*;
3 use wasm_bindgen::prelude::*;
4 #[cfg(web_sys_unstable_apis)]
5 #[wasm_bindgen]
6 extern "C" {
7     # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBlendState)]
8     #[derive(Debug, Clone, PartialEq, Eq)]
9     #[doc = "The `GpuBlendState` dictionary."]
10     #[doc = ""]
11     #[doc = "*This API requires the following crate features to be activated: `GpuBlendState`*"]
12     #[doc = ""]
13     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
14     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
15     pub type GpuBlendState;
16 }
17 #[cfg(web_sys_unstable_apis)]
18 impl GpuBlendState {
19     #[cfg(feature = "GpuBlendComponent")]
20     #[doc = "Construct a new `GpuBlendState`."]
21     #[doc = ""]
22     #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"]
23     #[doc = ""]
24     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
25     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
new(alpha: &GpuBlendComponent, color: &GpuBlendComponent) -> Self26     pub fn new(alpha: &GpuBlendComponent, color: &GpuBlendComponent) -> Self {
27         #[allow(unused_mut)]
28         let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
29         ret.alpha(alpha);
30         ret.color(color);
31         ret
32     }
33     #[cfg(web_sys_unstable_apis)]
34     #[cfg(feature = "GpuBlendComponent")]
35     #[doc = "Change the `alpha` field of this object."]
36     #[doc = ""]
37     #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"]
38     #[doc = ""]
39     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
40     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
alpha(&mut self, val: &GpuBlendComponent) -> &mut Self41     pub fn alpha(&mut self, val: &GpuBlendComponent) -> &mut Self {
42         use wasm_bindgen::JsValue;
43         let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alpha"), &JsValue::from(val));
44         debug_assert!(
45             r.is_ok(),
46             "setting properties should never fail on our dictionary objects"
47         );
48         let _ = r;
49         self
50     }
51     #[cfg(web_sys_unstable_apis)]
52     #[cfg(feature = "GpuBlendComponent")]
53     #[doc = "Change the `color` field of this object."]
54     #[doc = ""]
55     #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"]
56     #[doc = ""]
57     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
58     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
color(&mut self, val: &GpuBlendComponent) -> &mut Self59     pub fn color(&mut self, val: &GpuBlendComponent) -> &mut Self {
60         use wasm_bindgen::JsValue;
61         let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("color"), &JsValue::from(val));
62         debug_assert!(
63             r.is_ok(),
64             "setting properties should never fail on our dictionary objects"
65         );
66         let _ = r;
67         self
68     }
69 }
70