web_sys/features/
gen_GpuVertexBufferLayout.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 = GPUVertexBufferLayout)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `GpuVertexBufferLayout` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"]
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 GpuVertexBufferLayout;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `arrayStride` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"]
21    #[doc = ""]
22    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
24    #[wasm_bindgen(method, getter = "arrayStride")]
25    pub fn get_array_stride(this: &GpuVertexBufferLayout) -> f64;
26    #[cfg(web_sys_unstable_apis)]
27    #[doc = "Change the `arrayStride` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"]
30    #[doc = ""]
31    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
32    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
33    #[wasm_bindgen(method, setter = "arrayStride")]
34    pub fn set_array_stride(this: &GpuVertexBufferLayout, val: f64);
35    #[cfg(web_sys_unstable_apis)]
36    #[doc = "Get the `attributes` field of this object."]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"]
39    #[doc = ""]
40    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
41    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
42    #[wasm_bindgen(method, getter = "attributes")]
43    pub fn get_attributes(this: &GpuVertexBufferLayout) -> ::js_sys::Array;
44    #[cfg(web_sys_unstable_apis)]
45    #[doc = "Change the `attributes` field of this object."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"]
48    #[doc = ""]
49    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
50    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
51    #[wasm_bindgen(method, setter = "attributes")]
52    pub fn set_attributes(this: &GpuVertexBufferLayout, val: &::wasm_bindgen::JsValue);
53    #[cfg(web_sys_unstable_apis)]
54    #[cfg(feature = "GpuVertexStepMode")]
55    #[doc = "Get the `stepMode` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`, `GpuVertexStepMode`*"]
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    #[wasm_bindgen(method, getter = "stepMode")]
62    pub fn get_step_mode(this: &GpuVertexBufferLayout) -> Option<GpuVertexStepMode>;
63    #[cfg(web_sys_unstable_apis)]
64    #[cfg(feature = "GpuVertexStepMode")]
65    #[doc = "Change the `stepMode` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`, `GpuVertexStepMode`*"]
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 = "stepMode")]
72    pub fn set_step_mode(this: &GpuVertexBufferLayout, val: GpuVertexStepMode);
73}
74#[cfg(web_sys_unstable_apis)]
75impl GpuVertexBufferLayout {
76    #[doc = "Construct a new `GpuVertexBufferLayout`."]
77    #[doc = ""]
78    #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"]
79    #[doc = ""]
80    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
81    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
82    pub fn new(array_stride: f64, attributes: &::wasm_bindgen::JsValue) -> Self {
83        #[allow(unused_mut)]
84        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
85        ret.set_array_stride(array_stride);
86        ret.set_attributes(attributes);
87        ret
88    }
89    #[cfg(web_sys_unstable_apis)]
90    #[deprecated = "Use `set_array_stride()` instead."]
91    pub fn array_stride(&mut self, val: f64) -> &mut Self {
92        self.set_array_stride(val);
93        self
94    }
95    #[cfg(web_sys_unstable_apis)]
96    #[deprecated = "Use `set_attributes()` instead."]
97    pub fn attributes(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
98        self.set_attributes(val);
99        self
100    }
101    #[cfg(web_sys_unstable_apis)]
102    #[cfg(feature = "GpuVertexStepMode")]
103    #[deprecated = "Use `set_step_mode()` instead."]
104    pub fn step_mode(&mut self, val: GpuVertexStepMode) -> &mut Self {
105        self.set_step_mode(val);
106        self
107    }
108}