web_sys/features/
gen_GpuBufferBinding.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 = GPUBufferBinding)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `GpuBufferBinding` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"]
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 GpuBufferBinding;
17 #[cfg(web_sys_unstable_apis)]
18 #[cfg(feature = "GpuBuffer")]
19 #[doc = "Get the `buffer` field of this object."]
20 #[doc = ""]
21 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"]
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 #[wasm_bindgen(method, getter = "buffer")]
26 pub fn get_buffer(this: &GpuBufferBinding) -> GpuBuffer;
27 #[cfg(web_sys_unstable_apis)]
28 #[cfg(feature = "GpuBuffer")]
29 #[doc = "Change the `buffer` field of this object."]
30 #[doc = ""]
31 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
35 #[wasm_bindgen(method, setter = "buffer")]
36 pub fn set_buffer(this: &GpuBufferBinding, val: &GpuBuffer);
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: `GpuBufferBinding`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
44 #[wasm_bindgen(method, getter = "offset")]
45 pub fn get_offset(this: &GpuBufferBinding) -> Option<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: `GpuBufferBinding`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
53 #[wasm_bindgen(method, setter = "offset")]
54 pub fn set_offset(this: &GpuBufferBinding, val: f64);
55 #[cfg(web_sys_unstable_apis)]
56 #[doc = "Get the `size` field of this object."]
57 #[doc = ""]
58 #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
62 #[wasm_bindgen(method, getter = "size")]
63 pub fn get_size(this: &GpuBufferBinding) -> Option<f64>;
64 #[cfg(web_sys_unstable_apis)]
65 #[doc = "Change the `size` field of this object."]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `GpuBufferBinding`*"]
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 = "size")]
72 pub fn set_size(this: &GpuBufferBinding, val: f64);
73}
74#[cfg(web_sys_unstable_apis)]
75impl GpuBufferBinding {
76 #[cfg(feature = "GpuBuffer")]
77 #[doc = "Construct a new `GpuBufferBinding`."]
78 #[doc = ""]
79 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferBinding`*"]
80 #[doc = ""]
81 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
82 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
83 pub fn new(buffer: &GpuBuffer) -> Self {
84 #[allow(unused_mut)]
85 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
86 ret.set_buffer(buffer);
87 ret
88 }
89 #[cfg(web_sys_unstable_apis)]
90 #[cfg(feature = "GpuBuffer")]
91 #[deprecated = "Use `set_buffer()` instead."]
92 pub fn buffer(&mut self, val: &GpuBuffer) -> &mut Self {
93 self.set_buffer(val);
94 self
95 }
96 #[cfg(web_sys_unstable_apis)]
97 #[deprecated = "Use `set_offset()` instead."]
98 pub fn offset(&mut self, val: f64) -> &mut Self {
99 self.set_offset(val);
100 self
101 }
102 #[cfg(web_sys_unstable_apis)]
103 #[deprecated = "Use `set_size()` instead."]
104 pub fn size(&mut self, val: f64) -> &mut Self {
105 self.set_size(val);
106 self
107 }
108}