maxcountryman_web_sys/features/
gen_GpuFragmentState.rs

1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[cfg(web_sys_unstable_apis)]
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUFragmentState)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `GpuFragmentState` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"]
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 GpuFragmentState;
16}
17#[cfg(web_sys_unstable_apis)]
18impl GpuFragmentState {
19    #[cfg(feature = "GpuShaderModule")]
20    #[doc = "Construct a new `GpuFragmentState`."]
21    #[doc = ""]
22    #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuShaderModule`*"]
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)*"]
26    pub fn new(
27        entry_point: &str,
28        module: &GpuShaderModule,
29        targets: &::wasm_bindgen::JsValue,
30    ) -> Self {
31        #[allow(unused_mut)]
32        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
33        ret.entry_point(entry_point);
34        ret.module(module);
35        ret.targets(targets);
36        ret
37    }
38    #[cfg(web_sys_unstable_apis)]
39    #[doc = "Change the `entryPoint` field of this object."]
40    #[doc = ""]
41    #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"]
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    pub fn entry_point(&mut self, val: &str) -> &mut Self {
46        use wasm_bindgen::JsValue;
47        let r = ::js_sys::Reflect::set(
48            self.as_ref(),
49            &JsValue::from("entryPoint"),
50            &JsValue::from(val),
51        );
52        debug_assert!(
53            r.is_ok(),
54            "setting properties should never fail on our dictionary objects"
55        );
56        let _ = r;
57        self
58    }
59    #[cfg(web_sys_unstable_apis)]
60    #[cfg(feature = "GpuShaderModule")]
61    #[doc = "Change the `module` field of this object."]
62    #[doc = ""]
63    #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuShaderModule`*"]
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 module(&mut self, val: &GpuShaderModule) -> &mut Self {
68        use wasm_bindgen::JsValue;
69        let r =
70            ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("module"), &JsValue::from(val));
71        debug_assert!(
72            r.is_ok(),
73            "setting properties should never fail on our dictionary objects"
74        );
75        let _ = r;
76        self
77    }
78    #[cfg(web_sys_unstable_apis)]
79    #[doc = "Change the `targets` field of this object."]
80    #[doc = ""]
81    #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"]
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 targets(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
86        use wasm_bindgen::JsValue;
87        let r = ::js_sys::Reflect::set(
88            self.as_ref(),
89            &JsValue::from("targets"),
90            &JsValue::from(val),
91        );
92        debug_assert!(
93            r.is_ok(),
94            "setting properties should never fail on our dictionary objects"
95        );
96        let _ = r;
97        self
98    }
99}