web_sys/features/
gen_GpuShaderModuleDescriptor.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 = GPUShaderModuleDescriptor)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `GpuShaderModuleDescriptor` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"]
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 GpuShaderModuleDescriptor;
17 #[cfg(web_sys_unstable_apis)]
18 #[doc = "Get the `label` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"]
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 = "label")]
25 pub fn get_label(this: &GpuShaderModuleDescriptor) -> Option<::alloc::string::String>;
26 #[cfg(web_sys_unstable_apis)]
27 #[doc = "Change the `label` field of this object."]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"]
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 = "label")]
34 pub fn set_label(this: &GpuShaderModuleDescriptor, val: &str);
35 #[cfg(web_sys_unstable_apis)]
36 #[doc = "Get the `code` field of this object."]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"]
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 = "code")]
43 pub fn get_code(this: &GpuShaderModuleDescriptor) -> ::alloc::string::String;
44 #[cfg(web_sys_unstable_apis)]
45 #[doc = "Change the `code` field of this object."]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"]
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 = "code")]
52 pub fn set_code(this: &GpuShaderModuleDescriptor, val: &str);
53 #[cfg(web_sys_unstable_apis)]
54 #[cfg(feature = "GpuShaderModuleCompilationHint")]
55 #[doc = "Get the `compilationHints` field of this object."]
56 #[doc = ""]
57 #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleCompilationHint`, `GpuShaderModuleDescriptor`*"]
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 = "compilationHints")]
62 pub fn get_compilation_hints(
63 this: &GpuShaderModuleDescriptor,
64 ) -> Option<::js_sys::Array<GpuShaderModuleCompilationHint>>;
65 #[cfg(web_sys_unstable_apis)]
66 #[cfg(feature = "GpuShaderModuleCompilationHint")]
67 #[doc = "Change the `compilationHints` field of this object."]
68 #[doc = ""]
69 #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleCompilationHint`, `GpuShaderModuleDescriptor`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
73 #[wasm_bindgen(method, setter = "compilationHints")]
74 pub fn set_compilation_hints(
75 this: &GpuShaderModuleDescriptor,
76 val: &[GpuShaderModuleCompilationHint],
77 );
78}
79#[cfg(web_sys_unstable_apis)]
80impl GpuShaderModuleDescriptor {
81 #[doc = "Construct a new `GpuShaderModuleDescriptor`."]
82 #[doc = ""]
83 #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"]
84 #[doc = ""]
85 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
86 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
87 pub fn new(code: &str) -> Self {
88 #[allow(unused_mut)]
89 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
90 ret.set_code(code);
91 ret
92 }
93 #[cfg(web_sys_unstable_apis)]
94 #[deprecated = "Use `set_label()` instead."]
95 pub fn label(&mut self, val: &str) -> &mut Self {
96 self.set_label(val);
97 self
98 }
99 #[cfg(web_sys_unstable_apis)]
100 #[deprecated = "Use `set_code()` instead."]
101 pub fn code(&mut self, val: &str) -> &mut Self {
102 self.set_code(val);
103 self
104 }
105 #[cfg(web_sys_unstable_apis)]
106 #[cfg(feature = "GpuShaderModuleCompilationHint")]
107 #[deprecated = "Use `set_compilation_hints()` instead."]
108 pub fn compilation_hints(&mut self, val: &[GpuShaderModuleCompilationHint]) -> &mut Self {
109 self.set_compilation_hints(val);
110 self
111 }
112}