maxcountryman_web_sys/features/
gen_GpuVertexBufferLayout.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[cfg(web_sys_unstable_apis)]
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUVertexBufferLayout)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `GpuVertexBufferLayout` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"]
12 #[doc = ""]
13 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
14 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
15 pub type GpuVertexBufferLayout;
16}
17#[cfg(web_sys_unstable_apis)]
18impl GpuVertexBufferLayout {
19 #[doc = "Construct a new `GpuVertexBufferLayout`."]
20 #[doc = ""]
21 #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"]
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 pub fn new(array_stride: f64, attributes: &::wasm_bindgen::JsValue) -> Self {
26 #[allow(unused_mut)]
27 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
28 ret.array_stride(array_stride);
29 ret.attributes(attributes);
30 ret
31 }
32 #[cfg(web_sys_unstable_apis)]
33 #[doc = "Change the `arrayStride` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"]
36 #[doc = ""]
37 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
38 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
39 pub fn array_stride(&mut self, val: f64) -> &mut Self {
40 use wasm_bindgen::JsValue;
41 let r = ::js_sys::Reflect::set(
42 self.as_ref(),
43 &JsValue::from("arrayStride"),
44 &JsValue::from(val),
45 );
46 debug_assert!(
47 r.is_ok(),
48 "setting properties should never fail on our dictionary objects"
49 );
50 let _ = r;
51 self
52 }
53 #[cfg(web_sys_unstable_apis)]
54 #[doc = "Change the `attributes` field of this object."]
55 #[doc = ""]
56 #[doc = "*This API requires the following crate features to be activated: `GpuVertexBufferLayout`*"]
57 #[doc = ""]
58 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
59 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
60 pub fn attributes(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
61 use wasm_bindgen::JsValue;
62 let r = ::js_sys::Reflect::set(
63 self.as_ref(),
64 &JsValue::from("attributes"),
65 &JsValue::from(val),
66 );
67 debug_assert!(
68 r.is_ok(),
69 "setting properties should never fail on our dictionary objects"
70 );
71 let _ = r;
72 self
73 }
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
82 pub fn step_mode(&mut self, val: GpuVertexStepMode) -> &mut Self {
83 use wasm_bindgen::JsValue;
84 let r = ::js_sys::Reflect::set(
85 self.as_ref(),
86 &JsValue::from("stepMode"),
87 &JsValue::from(val),
88 );
89 debug_assert!(
90 r.is_ok(),
91 "setting properties should never fail on our dictionary objects"
92 );
93 let _ = r;
94 self
95 }
96}