web_sys/features/
gen_GpuVertexAttribute.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 = 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    #[cfg(web_sys_unstable_apis)]
18    #[cfg(feature = "GpuVertexFormat")]
19    #[doc = "Get the `format` field of this object."]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"]
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    #[wasm_bindgen(method, getter = "format")]
26    pub fn get_format(this: &GpuVertexAttribute) -> GpuVertexFormat;
27    #[cfg(web_sys_unstable_apis)]
28    #[cfg(feature = "GpuVertexFormat")]
29    #[doc = "Change the `format` field of this object."]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"]
32    #[doc = ""]
33    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
35    #[wasm_bindgen(method, setter = "format")]
36    pub fn set_format(this: &GpuVertexAttribute, val: GpuVertexFormat);
37    #[cfg(web_sys_unstable_apis)]
38    #[doc = "Get the `offset` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"]
41    #[doc = ""]
42    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
43    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
44    #[wasm_bindgen(method, getter = "offset")]
45    pub fn get_offset(this: &GpuVertexAttribute) -> f64;
46    #[cfg(web_sys_unstable_apis)]
47    #[doc = "Change the `offset` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"]
50    #[doc = ""]
51    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
53    #[wasm_bindgen(method, setter = "offset")]
54    pub fn set_offset(this: &GpuVertexAttribute, val: f64);
55    #[cfg(web_sys_unstable_apis)]
56    #[doc = "Get the `shaderLocation` field of this object."]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"]
59    #[doc = ""]
60    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
61    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
62    #[wasm_bindgen(method, getter = "shaderLocation")]
63    pub fn get_shader_location(this: &GpuVertexAttribute) -> u32;
64    #[cfg(web_sys_unstable_apis)]
65    #[doc = "Change the `shaderLocation` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
71    #[wasm_bindgen(method, setter = "shaderLocation")]
72    pub fn set_shader_location(this: &GpuVertexAttribute, val: u32);
73}
74#[cfg(web_sys_unstable_apis)]
75impl GpuVertexAttribute {
76    #[cfg(feature = "GpuVertexFormat")]
77    #[doc = "Construct a new `GpuVertexAttribute`."]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"]
80    #[doc = ""]
81    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
82    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
83    pub fn new(format: GpuVertexFormat, offset: f64, shader_location: u32) -> Self {
84        #[allow(unused_mut)]
85        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
86        ret.set_format(format);
87        ret.set_offset(offset);
88        ret.set_shader_location(shader_location);
89        ret
90    }
91    #[cfg(web_sys_unstable_apis)]
92    #[cfg(feature = "GpuVertexFormat")]
93    #[deprecated = "Use `set_format()` instead."]
94    pub fn format(&mut self, val: GpuVertexFormat) -> &mut Self {
95        self.set_format(val);
96        self
97    }
98    #[cfg(web_sys_unstable_apis)]
99    #[deprecated = "Use `set_offset()` instead."]
100    pub fn offset(&mut self, val: f64) -> &mut Self {
101        self.set_offset(val);
102        self
103    }
104    #[cfg(web_sys_unstable_apis)]
105    #[deprecated = "Use `set_shader_location()` instead."]
106    pub fn shader_location(&mut self, val: u32) -> &mut Self {
107        self.set_shader_location(val);
108        self
109    }
110}