maxcountryman_web_sys/features/
gen_GpuShaderModuleDescriptor.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 = GPUShaderModuleDescriptor)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `GpuShaderModuleDescriptor` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"]
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 GpuShaderModuleDescriptor;
16}
17#[cfg(web_sys_unstable_apis)]
18impl GpuShaderModuleDescriptor {
19    #[doc = "Construct a new `GpuShaderModuleDescriptor`."]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"]
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    pub fn new(code: &str) -> Self {
26        #[allow(unused_mut)]
27        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
28        ret.code(code);
29        ret
30    }
31    #[cfg(web_sys_unstable_apis)]
32    #[doc = "Change the `label` field of this object."]
33    #[doc = ""]
34    #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"]
35    #[doc = ""]
36    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
37    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
38    pub fn label(&mut self, val: &str) -> &mut Self {
39        use wasm_bindgen::JsValue;
40        let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val));
41        debug_assert!(
42            r.is_ok(),
43            "setting properties should never fail on our dictionary objects"
44        );
45        let _ = r;
46        self
47    }
48    #[cfg(web_sys_unstable_apis)]
49    #[doc = "Change the `code` field of this object."]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"]
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    pub fn code(&mut self, val: &str) -> &mut Self {
56        use wasm_bindgen::JsValue;
57        let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("code"), &JsValue::from(val));
58        debug_assert!(
59            r.is_ok(),
60            "setting properties should never fail on our dictionary objects"
61        );
62        let _ = r;
63        self
64    }
65    #[cfg(web_sys_unstable_apis)]
66    #[doc = "Change the `sourceMap` field of this object."]
67    #[doc = ""]
68    #[doc = "*This API requires the following crate features to be activated: `GpuShaderModuleDescriptor`*"]
69    #[doc = ""]
70    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
71    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
72    pub fn source_map(&mut self, val: &::js_sys::Object) -> &mut Self {
73        use wasm_bindgen::JsValue;
74        let r = ::js_sys::Reflect::set(
75            self.as_ref(),
76            &JsValue::from("sourceMap"),
77            &JsValue::from(val),
78        );
79        debug_assert!(
80            r.is_ok(),
81            "setting properties should never fail on our dictionary objects"
82        );
83        let _ = r;
84        self
85    }
86}