web_sys/features/
gen_GpuBlendState.rs1#![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 = GPUBlendState)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `GpuBlendState` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `GpuBlendState`*"]
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 GpuBlendState;
17 #[cfg(web_sys_unstable_apis)]
18 #[cfg(feature = "GpuBlendComponent")]
19 #[doc = "Get the `alpha` field of this object."]
20 #[doc = ""]
21 #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"]
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 = "alpha")]
26 pub fn get_alpha(this: &GpuBlendState) -> GpuBlendComponent;
27 #[cfg(web_sys_unstable_apis)]
28 #[cfg(feature = "GpuBlendComponent")]
29 #[doc = "Change the `alpha` field of this object."]
30 #[doc = ""]
31 #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"]
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 = "alpha")]
36 pub fn set_alpha(this: &GpuBlendState, val: &GpuBlendComponent);
37 #[cfg(web_sys_unstable_apis)]
38 #[cfg(feature = "GpuBlendComponent")]
39 #[doc = "Get the `color` field of this object."]
40 #[doc = ""]
41 #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"]
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 = "color")]
46 pub fn get_color(this: &GpuBlendState) -> GpuBlendComponent;
47 #[cfg(web_sys_unstable_apis)]
48 #[cfg(feature = "GpuBlendComponent")]
49 #[doc = "Change the `color` field of this object."]
50 #[doc = ""]
51 #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"]
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 = "color")]
56 pub fn set_color(this: &GpuBlendState, val: &GpuBlendComponent);
57}
58#[cfg(web_sys_unstable_apis)]
59impl GpuBlendState {
60 #[cfg(feature = "GpuBlendComponent")]
61 #[doc = "Construct a new `GpuBlendState`."]
62 #[doc = ""]
63 #[doc = "*This API requires the following crate features to be activated: `GpuBlendComponent`, `GpuBlendState`*"]
64 #[doc = ""]
65 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
66 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
67 pub fn new(alpha: &GpuBlendComponent, color: &GpuBlendComponent) -> Self {
68 #[allow(unused_mut)]
69 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
70 ret.set_alpha(alpha);
71 ret.set_color(color);
72 ret
73 }
74 #[cfg(web_sys_unstable_apis)]
75 #[cfg(feature = "GpuBlendComponent")]
76 #[deprecated = "Use `set_alpha()` instead."]
77 pub fn alpha(&mut self, val: &GpuBlendComponent) -> &mut Self {
78 self.set_alpha(val);
79 self
80 }
81 #[cfg(web_sys_unstable_apis)]
82 #[cfg(feature = "GpuBlendComponent")]
83 #[deprecated = "Use `set_color()` instead."]
84 pub fn color(&mut self, val: &GpuBlendComponent) -> &mut Self {
85 self.set_color(val);
86 self
87 }
88}