1 #![allow(unused_imports)]
2 use super::*;
3 use wasm_bindgen::prelude::*;
4 #[cfg(web_sys_unstable_apis)]
5 #[wasm_bindgen]
6 extern "C" {
7     # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUBufferBinding)]
8     #[derive(Debug, Clone, PartialEq, Eq)]
9     #[doc = "The `GpuBufferBinding` dictionary."]
10     #[doc = ""]
11     #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"]
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 GpuBufferBinding;
16 }
17 #[cfg(web_sys_unstable_apis)]
18 impl GpuBufferBinding {
19     #[cfg(feature = "GpuBuffer")]
20     #[doc = "Construct a new `GpuBufferBinding`."]
21     #[doc = ""]
22     #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"]
23     #[doc = ""]
24     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
25     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
new(buffer: &GpuBuffer) -> Self26     pub fn new(buffer: &GpuBuffer) -> Self {
27         #[allow(unused_mut)]
28         let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
29         ret.buffer(buffer);
30         ret
31     }
32     #[cfg(web_sys_unstable_apis)]
33     #[cfg(feature = "GpuBuffer")]
34     #[doc = "Change the `buffer` field of this object."]
35     #[doc = ""]
36     #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"]
37     #[doc = ""]
38     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
39     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
buffer(&mut self, val: &GpuBuffer) -> &mut Self40     pub fn buffer(&mut self, val: &GpuBuffer) -> &mut Self {
41         use wasm_bindgen::JsValue;
42         let r =
43             ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("buffer"), &JsValue::from(val));
44         debug_assert!(
45             r.is_ok(),
46             "setting properties should never fail on our dictionary objects"
47         );
48         let _ = r;
49         self
50     }
51     #[cfg(web_sys_unstable_apis)]
52     #[doc = "Change the `offset` field of this object."]
53     #[doc = ""]
54     #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"]
55     #[doc = ""]
56     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
57     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
offset(&mut self, val: f64) -> &mut Self58     pub fn offset(&mut self, val: f64) -> &mut Self {
59         use wasm_bindgen::JsValue;
60         let r =
61             ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("offset"), &JsValue::from(val));
62         debug_assert!(
63             r.is_ok(),
64             "setting properties should never fail on our dictionary objects"
65         );
66         let _ = r;
67         self
68     }
69     #[cfg(web_sys_unstable_apis)]
70     #[doc = "Change the `size` field of this object."]
71     #[doc = ""]
72     #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"]
73     #[doc = ""]
74     #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
75     #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
size(&mut self, val: f64) -> &mut Self76     pub fn size(&mut self, val: f64) -> &mut Self {
77         use wasm_bindgen::JsValue;
78         let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("size"), &JsValue::from(val));
79         debug_assert!(
80             r.is_ok(),
81             "setting properties should never fail on our dictionary objects"
82         );
83         let _ = r;
84         self
85     }
86 }
87