Skip to main content

web_sys/features/
gen_GpuFragmentState.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 = GPUFragmentState)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `GpuFragmentState` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"]
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 GpuFragmentState;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `constants` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"]
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 = "constants")]
25    pub fn get_constants(this: &GpuFragmentState) -> Option<::js_sys::Object<::js_sys::Number>>;
26    #[cfg(web_sys_unstable_apis)]
27    #[doc = "Change the `constants` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"]
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 = "constants")]
34    pub fn set_constants(this: &GpuFragmentState, val: &::js_sys::Object<::js_sys::Number>);
35    #[cfg(web_sys_unstable_apis)]
36    #[doc = "Get the `entryPoint` field of this object."]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"]
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 = "entryPoint")]
43    pub fn get_entry_point(this: &GpuFragmentState) -> Option<::alloc::string::String>;
44    #[cfg(web_sys_unstable_apis)]
45    #[doc = "Change the `entryPoint` field of this object."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`*"]
48    #[doc = ""]
49    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
50    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
51    #[wasm_bindgen(method, setter = "entryPoint")]
52    pub fn set_entry_point(this: &GpuFragmentState, val: &str);
53    #[cfg(web_sys_unstable_apis)]
54    #[cfg(feature = "GpuShaderModule")]
55    #[doc = "Get the `module` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuShaderModule`*"]
58    #[doc = ""]
59    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
60    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
61    #[wasm_bindgen(method, getter = "module")]
62    pub fn get_module(this: &GpuFragmentState) -> GpuShaderModule;
63    #[cfg(web_sys_unstable_apis)]
64    #[cfg(feature = "GpuShaderModule")]
65    #[doc = "Change the `module` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `GpuFragmentState`, `GpuShaderModule`*"]
68    #[doc = ""]
69    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
70    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
71    #[wasm_bindgen(method, setter = "module")]
72    pub fn set_module(this: &GpuFragmentState, val: &GpuShaderModule);
73    #[cfg(web_sys_unstable_apis)]
74    #[cfg(feature = "GpuColorTargetState")]
75    #[doc = "Get the `targets` field of this object."]
76    #[doc = ""]
77    #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuFragmentState`*"]
78    #[doc = ""]
79    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
80    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
81    #[wasm_bindgen(method, getter = "targets")]
82    pub fn get_targets(
83        this: &GpuFragmentState,
84    ) -> ::js_sys::Array<::js_sys::JsOption<GpuColorTargetState>>;
85    #[cfg(web_sys_unstable_apis)]
86    #[cfg(feature = "GpuColorTargetState")]
87    #[doc = "Change the `targets` field of this object."]
88    #[doc = ""]
89    #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuFragmentState`*"]
90    #[doc = ""]
91    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
92    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
93    #[wasm_bindgen(method, setter = "targets")]
94    pub fn set_targets(this: &GpuFragmentState, val: &[::js_sys::JsOption<GpuColorTargetState>]);
95}
96#[cfg(web_sys_unstable_apis)]
97impl GpuFragmentState {
98    #[cfg(all(feature = "GpuColorTargetState", feature = "GpuShaderModule",))]
99    #[doc = "Construct a new `GpuFragmentState`."]
100    #[doc = ""]
101    #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuFragmentState`, `GpuShaderModule`*"]
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    pub fn new(
106        module: &GpuShaderModule,
107        targets: &[::js_sys::JsOption<GpuColorTargetState>],
108    ) -> Self {
109        #[allow(unused_mut)]
110        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
111        ret.set_module(module);
112        ret.set_targets(targets);
113        ret
114    }
115    #[cfg(web_sys_unstable_apis)]
116    #[deprecated = "Use `set_constants()` instead."]
117    pub fn constants(&mut self, val: &::js_sys::Object<::js_sys::Number>) -> &mut Self {
118        self.set_constants(val);
119        self
120    }
121    #[cfg(web_sys_unstable_apis)]
122    #[deprecated = "Use `set_entry_point()` instead."]
123    pub fn entry_point(&mut self, val: &str) -> &mut Self {
124        self.set_entry_point(val);
125        self
126    }
127    #[cfg(web_sys_unstable_apis)]
128    #[cfg(feature = "GpuShaderModule")]
129    #[deprecated = "Use `set_module()` instead."]
130    pub fn module(&mut self, val: &GpuShaderModule) -> &mut Self {
131        self.set_module(val);
132        self
133    }
134    #[cfg(web_sys_unstable_apis)]
135    #[cfg(feature = "GpuColorTargetState")]
136    #[deprecated = "Use `set_targets()` instead."]
137    pub fn targets(&mut self, val: &[::js_sys::JsOption<GpuColorTargetState>]) -> &mut Self {
138        self.set_targets(val);
139        self
140    }
141}