web_sys/features/
gen_GpuVertexBufferLayout.rs1#![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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
33 #[wasm_bindgen(method, setter = "arrayStride")]
34 pub fn set_array_stride(this: &GpuVertexBufferLayout, val: u32);
35 #[cfg(web_sys_unstable_apis)]
36 #[doc = "Change the `arrayStride` 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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
42 #[wasm_bindgen(method, setter = "arrayStride")]
43 pub fn set_array_stride_f64(this: &GpuVertexBufferLayout, val: f64);
44 #[cfg(web_sys_unstable_apis)]
45 #[cfg(feature = "GpuVertexAttribute")]
46 #[doc = "Get the `attributes` field of this object."]
47 #[doc = ""]
48 #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexBufferLayout`*"]
49 #[doc = ""]
50 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
51 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
52 #[wasm_bindgen(method, getter = "attributes")]
53 pub fn get_attributes(this: &GpuVertexBufferLayout) -> ::js_sys::Array<GpuVertexAttribute>;
54 #[cfg(web_sys_unstable_apis)]
55 #[cfg(feature = "GpuVertexAttribute")]
56 #[doc = "Change the `attributes` field of this object."]
57 #[doc = ""]
58 #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexBufferLayout`*"]
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 = "attributes")]
63 pub fn set_attributes(this: &GpuVertexBufferLayout, val: &[GpuVertexAttribute]);
64 #[cfg(web_sys_unstable_apis)]
65 #[cfg(feature = "GpuVertexStepMode")]
66 #[doc = "Get the `stepMode` field of this object."]
67 #[doc = ""]
68 #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`, `GpuVertexStepMode`*"]
69 #[doc = ""]
70 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
71 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
72 #[wasm_bindgen(method, getter = "stepMode")]
73 pub fn get_step_mode(this: &GpuVertexBufferLayout) -> Option<GpuVertexStepMode>;
74 #[cfg(web_sys_unstable_apis)]
75 #[cfg(feature = "GpuVertexStepMode")]
76 #[doc = "Change the `stepMode` field of this object."]
77 #[doc = ""]
78 #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`, `GpuVertexStepMode`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
82 #[wasm_bindgen(method, setter = "stepMode")]
83 pub fn set_step_mode(this: &GpuVertexBufferLayout, val: GpuVertexStepMode);
84}
85#[cfg(web_sys_unstable_apis)]
86impl GpuVertexBufferLayout {
87 #[cfg(feature = "GpuVertexAttribute")]
88 #[doc = "Construct a new `GpuVertexBufferLayout`."]
89 #[doc = ""]
90 #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexBufferLayout`*"]
91 #[doc = ""]
92 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
93 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
94 pub fn new(array_stride: u32, attributes: &[GpuVertexAttribute]) -> Self {
95 #[allow(unused_mut)]
96 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
97 ret.set_array_stride(array_stride);
98 ret.set_attributes(attributes);
99 ret
100 }
101 #[cfg(feature = "GpuVertexAttribute")]
102 #[doc = "Construct a new `GpuVertexBufferLayout`."]
103 #[doc = ""]
104 #[doc = "*This API requires the following crate features to be activated: `GpuVertexAttribute`, `GpuVertexBufferLayout`*"]
105 #[doc = ""]
106 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
107 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
108 pub fn new_with_f64(array_stride: f64, attributes: &[GpuVertexAttribute]) -> Self {
109 #[allow(unused_mut)]
110 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
111 ret.set_array_stride_f64(array_stride);
112 ret.set_attributes(attributes);
113 ret
114 }
115 #[cfg(web_sys_unstable_apis)]
116 #[deprecated = "Use `set_array_stride()` instead."]
117 pub fn array_stride(&mut self, val: u32) -> &mut Self {
118 self.set_array_stride(val);
119 self
120 }
121 #[cfg(web_sys_unstable_apis)]
122 #[cfg(feature = "GpuVertexAttribute")]
123 #[deprecated = "Use `set_attributes()` instead."]
124 pub fn attributes(&mut self, val: &[GpuVertexAttribute]) -> &mut Self {
125 self.set_attributes(val);
126 self
127 }
128 #[cfg(web_sys_unstable_apis)]
129 #[cfg(feature = "GpuVertexStepMode")]
130 #[deprecated = "Use `set_step_mode()` instead."]
131 pub fn step_mode(&mut self, val: GpuVertexStepMode) -> &mut Self {
132 self.set_step_mode(val);
133 self
134 }
135}