Skip to main content

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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
53    #[wasm_bindgen(method, setter = "offset")]
54    pub fn set_offset(this: &GpuVertexAttribute, val: u32);
55    #[cfg(web_sys_unstable_apis)]
56    #[doc = "Change the `offset` 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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
62    #[wasm_bindgen(method, setter = "offset")]
63    pub fn set_offset_f64(this: &GpuVertexAttribute, val: f64);
64    #[cfg(web_sys_unstable_apis)]
65    #[doc = "Get 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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
71    #[wasm_bindgen(method, getter = "shaderLocation")]
72    pub fn get_shader_location(this: &GpuVertexAttribute) -> u32;
73    #[cfg(web_sys_unstable_apis)]
74    #[doc = "Change the `shaderLocation` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`*"]
77    #[doc = ""]
78    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
79    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
80    #[wasm_bindgen(method, setter = "shaderLocation")]
81    pub fn set_shader_location(this: &GpuVertexAttribute, val: u32);
82}
83#[cfg(web_sys_unstable_apis)]
84impl GpuVertexAttribute {
85    #[cfg(feature = "GpuVertexFormat")]
86    #[doc = "Construct a new `GpuVertexAttribute`."]
87    #[doc = ""]
88    #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"]
89    #[doc = ""]
90    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
91    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
92    pub fn new(format: GpuVertexFormat, offset: u32, shader_location: u32) -> Self {
93        #[allow(unused_mut)]
94        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
95        ret.set_format(format);
96        ret.set_offset(offset);
97        ret.set_shader_location(shader_location);
98        ret
99    }
100    #[cfg(feature = "GpuVertexFormat")]
101    #[doc = "Construct a new `GpuVertexAttribute`."]
102    #[doc = ""]
103    #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexFormat`*"]
104    #[doc = ""]
105    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
106    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
107    pub fn new_with_f64(format: GpuVertexFormat, offset: f64, shader_location: u32) -> Self {
108        #[allow(unused_mut)]
109        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
110        ret.set_format(format);
111        ret.set_offset_f64(offset);
112        ret.set_shader_location(shader_location);
113        ret
114    }
115    #[cfg(web_sys_unstable_apis)]
116    #[cfg(feature = "GpuVertexFormat")]
117    #[deprecated = "Use `set_format()` instead."]
118    pub fn format(&mut self, val: GpuVertexFormat) -> &mut Self {
119        self.set_format(val);
120        self
121    }
122    #[cfg(web_sys_unstable_apis)]
123    #[deprecated = "Use `set_offset()` instead."]
124    pub fn offset(&mut self, val: u32) -> &mut Self {
125        self.set_offset(val);
126        self
127    }
128    #[cfg(web_sys_unstable_apis)]
129    #[deprecated = "Use `set_shader_location()` instead."]
130    pub fn shader_location(&mut self, val: u32) -> &mut Self {
131        self.set_shader_location(val);
132        self
133    }
134}