]>
git.proxmox.com Git - rustc.git/blob - vendor/web-sys/src/features/gen_GpuVertexAttribute.rs
1 #![allow(unused_imports)]
4 use wasm_bindgen
::prelude
::*;
5 #[cfg(web_sys_unstable_apis)]
8 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUVertexAttribute)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `GpuVertexAttribute` dictionary."]
12 #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"]
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
;
18 #[cfg(web_sys_unstable_apis)]
19 impl GpuVertexAttribute
{
20 #[cfg(feature = "GpuVertexFormat")]
21 #[doc = "Construct a new `GpuVertexAttribute`."]
23 #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"]
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 {
29 let mut ret
: Self = ::wasm_bindgen
::JsCast
::unchecked_into(::js_sys
::Object
::new());
32 ret
.shader_location(shader_location
);
35 #[cfg(web_sys_unstable_apis)]
36 #[cfg(feature = "GpuVertexFormat")]
37 #[doc = "Change the `format` field of this object."]
39 #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"]
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
;
46 ::js_sys
::Reflect
::set(self.as_ref(), &JsValue
::from("format"), &JsValue
::from(val
));
49 "setting properties should never fail on our dictionary objects"
54 #[cfg(web_sys_unstable_apis)]
55 #[doc = "Change the `offset` field of this object."]
57 #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"]
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
;
64 ::js_sys
::Reflect
::set(self.as_ref(), &JsValue
::from("offset"), &JsValue
::from(val
));
67 "setting properties should never fail on our dictionary objects"
72 #[cfg(web_sys_unstable_apis)]
73 #[doc = "Change the `shaderLocation` field of this object."]
75 #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"]
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(
83 &JsValue
::from("shaderLocation"),
88 "setting properties should never fail on our dictionary objects"