]> git.proxmox.com Git - rustc.git/blob - vendor/web-sys/src/features/gen_GpuVertexAttribute.rs
New upstream version 1.72.1+dfsg1
[rustc.git] / vendor / web-sys / src / features / gen_GpuVertexAttribute.rs
1 #![allow(unused_imports)]
2 #![allow(clippy::all)]
3 use super::*;
4 use wasm_bindgen::prelude::*;
5 #[cfg(web_sys_unstable_apis)]
6 #[wasm_bindgen]
7 extern "C" {
8 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUVertexAttribute)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `GpuVertexAttribute` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"]
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 GpuVertexAttribute;
17 }
18 #[cfg(web_sys_unstable_apis)]
19 impl GpuVertexAttribute {
20 #[cfg(feature = "GpuVertexFormat")]
21 #[doc = "Construct a new `GpuVertexAttribute`."]
22 #[doc = ""]
23 #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"]
24 #[doc = ""]
25 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
26 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
27 pub fn new(format: GpuVertexFormat, offset: f64, shader_location: u32) -> Self {
28 #[allow(unused_mut)]
29 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
30 ret.format(format);
31 ret.offset(offset);
32 ret.shader_location(shader_location);
33 ret
34 }
35 #[cfg(web_sys_unstable_apis)]
36 #[cfg(feature = "GpuVertexFormat")]
37 #[doc = "Change the `format` field of this object."]
38 #[doc = ""]
39 #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"]
40 #[doc = ""]
41 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
42 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
43 pub fn format(&mut self, val: GpuVertexFormat) -> &mut Self {
44 use wasm_bindgen::JsValue;
45 let r =
46 ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val));
47 debug_assert!(
48 r.is_ok(),
49 "setting properties should never fail on our dictionary objects"
50 );
51 let _ = r;
52 self
53 }
54 #[cfg(web_sys_unstable_apis)]
55 #[doc = "Change the `offset` field of this object."]
56 #[doc = ""]
57 #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
61 pub fn offset(&mut self, val: f64) -> &mut Self {
62 use wasm_bindgen::JsValue;
63 let r =
64 ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val));
65 debug_assert!(
66 r.is_ok(),
67 "setting properties should never fail on our dictionary objects"
68 );
69 let _ = r;
70 self
71 }
72 #[cfg(web_sys_unstable_apis)]
73 #[doc = "Change the `shaderLocation` field of this object."]
74 #[doc = ""]
75 #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"]
76 #[doc = ""]
77 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
78 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
79 pub fn shader_location(&mut self, val: u32) -> &mut Self {
80 use wasm_bindgen::JsValue;
81 let r = ::js_sys::Reflect::set(
82 self.as_ref(),
83 &JsValue::from("shaderLocation"),
84 &JsValue::from(val),
85 );
86 debug_assert!(
87 r.is_ok(),
88 "setting properties should never fail on our dictionary objects"
89 );
90 let _ = r;
91 self
92 }
93 }