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(
9 extends = "::js_sys::Object",
10 js_name = "GPUBuffer",
11 typescript_type = "GPUBuffer"
12 )]
13 #[derive(Debug, Clone, PartialEq, Eq)]
14 #[doc = "The `GpuBuffer` class."]
15 #[doc = ""]
16 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer)"]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
19 #[doc = ""]
20 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
21 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
22 pub type GpuBuffer;
23 #[cfg(web_sys_unstable_apis)]
24 #[wasm_bindgen(method, getter, js_class = "GPUBuffer", js_name = "size")]
25 #[doc = "Getter for the `size` field of this object."]
26 #[doc = ""]
27 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/size)"]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
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 pub fn size(this: &GpuBuffer) -> f64;
34 #[cfg(web_sys_unstable_apis)]
35 #[wasm_bindgen(method, getter, js_class = "GPUBuffer", js_name = "usage")]
36 #[doc = "Getter for the `usage` field of this object."]
37 #[doc = ""]
38 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/usage)"]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
44 pub fn usage(this: &GpuBuffer) -> u32;
45 #[cfg(web_sys_unstable_apis)]
46 #[cfg(feature = "GpuBufferMapState")]
47 #[wasm_bindgen(method, getter, js_class = "GPUBuffer", js_name = "mapState")]
48 #[doc = "Getter for the `mapState` field of this object."]
49 #[doc = ""]
50 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapState)"]
51 #[doc = ""]
52 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`, `GpuBufferMapState`*"]
53 #[doc = ""]
54 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
55 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
56 pub fn map_state(this: &GpuBuffer) -> GpuBufferMapState;
57 #[cfg(web_sys_unstable_apis)]
58 #[wasm_bindgen(method, getter, js_class = "GPUBuffer", js_name = "label")]
59 #[doc = "Getter for the `label` field of this object."]
60 #[doc = ""]
61 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/label)"]
62 #[doc = ""]
63 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
64 #[doc = ""]
65 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
66 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
67 pub fn label(this: &GpuBuffer) -> ::alloc::string::String;
68 #[cfg(web_sys_unstable_apis)]
69 #[wasm_bindgen(method, setter, js_class = "GPUBuffer", js_name = "label")]
70 #[doc = "Setter for the `label` field of this object."]
71 #[doc = ""]
72 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/label)"]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
75 #[doc = ""]
76 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
77 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
78 pub fn set_label(this: &GpuBuffer, value: &str);
79 #[cfg(web_sys_unstable_apis)]
80 #[wasm_bindgen(method, js_class = "GPUBuffer")]
81 #[doc = "The `destroy()` method."]
82 #[doc = ""]
83 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/destroy)"]
84 #[doc = ""]
85 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
86 #[doc = ""]
87 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
88 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
89 pub fn destroy(this: &GpuBuffer);
90 #[cfg(web_sys_unstable_apis)]
91 #[wasm_bindgen(catch, method, js_class = "GPUBuffer", js_name = "getMappedRange")]
92 #[doc = "The `getMappedRange()` method."]
93 #[doc = ""]
94 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"]
95 #[doc = ""]
96 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
97 #[doc = ""]
98 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
99 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
100 pub fn get_mapped_range(this: &GpuBuffer) -> Result<::js_sys::ArrayBuffer, JsValue>;
101 #[cfg(web_sys_unstable_apis)]
102 #[wasm_bindgen(catch, method, js_class = "GPUBuffer", js_name = "getMappedRange")]
103 #[doc = "The `getMappedRange()` method."]
104 #[doc = ""]
105 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"]
106 #[doc = ""]
107 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
108 #[doc = ""]
109 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
110 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
111 pub fn get_mapped_range_with_u32(
112 this: &GpuBuffer,
113 offset: u32,
114 ) -> Result<::js_sys::ArrayBuffer, JsValue>;
115 #[cfg(web_sys_unstable_apis)]
116 #[wasm_bindgen(catch, method, js_class = "GPUBuffer", js_name = "getMappedRange")]
117 #[doc = "The `getMappedRange()` method."]
118 #[doc = ""]
119 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"]
120 #[doc = ""]
121 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
122 #[doc = ""]
123 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
124 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
125 pub fn get_mapped_range_with_f64(
126 this: &GpuBuffer,
127 offset: f64,
128 ) -> Result<::js_sys::ArrayBuffer, JsValue>;
129 #[cfg(web_sys_unstable_apis)]
130 #[wasm_bindgen(catch, method, js_class = "GPUBuffer", js_name = "getMappedRange")]
131 #[doc = "The `getMappedRange()` method."]
132 #[doc = ""]
133 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"]
134 #[doc = ""]
135 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
136 #[doc = ""]
137 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
138 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
139 pub fn get_mapped_range_with_u32_and_u32(
140 this: &GpuBuffer,
141 offset: u32,
142 size: u32,
143 ) -> Result<::js_sys::ArrayBuffer, JsValue>;
144 #[cfg(web_sys_unstable_apis)]
145 #[wasm_bindgen(catch, method, js_class = "GPUBuffer", js_name = "getMappedRange")]
146 #[doc = "The `getMappedRange()` method."]
147 #[doc = ""]
148 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"]
149 #[doc = ""]
150 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
151 #[doc = ""]
152 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
153 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
154 pub fn get_mapped_range_with_f64_and_u32(
155 this: &GpuBuffer,
156 offset: f64,
157 size: u32,
158 ) -> Result<::js_sys::ArrayBuffer, JsValue>;
159 #[cfg(web_sys_unstable_apis)]
160 #[wasm_bindgen(catch, method, js_class = "GPUBuffer", js_name = "getMappedRange")]
161 #[doc = "The `getMappedRange()` method."]
162 #[doc = ""]
163 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"]
164 #[doc = ""]
165 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
166 #[doc = ""]
167 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
168 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
169 pub fn get_mapped_range_with_u32_and_f64(
170 this: &GpuBuffer,
171 offset: u32,
172 size: f64,
173 ) -> Result<::js_sys::ArrayBuffer, JsValue>;
174 #[cfg(web_sys_unstable_apis)]
175 #[wasm_bindgen(catch, method, js_class = "GPUBuffer", js_name = "getMappedRange")]
176 #[doc = "The `getMappedRange()` method."]
177 #[doc = ""]
178 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/getMappedRange)"]
179 #[doc = ""]
180 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
181 #[doc = ""]
182 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
183 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
184 pub fn get_mapped_range_with_f64_and_f64(
185 this: &GpuBuffer,
186 offset: f64,
187 size: f64,
188 ) -> Result<::js_sys::ArrayBuffer, JsValue>;
189 #[cfg(web_sys_unstable_apis)]
190 #[wasm_bindgen(method, js_class = "GPUBuffer", js_name = "mapAsync")]
191 #[doc = "The `mapAsync()` method."]
192 #[doc = ""]
193 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapAsync)"]
194 #[doc = ""]
195 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
196 #[doc = ""]
197 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
198 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
199 pub fn map_async(this: &GpuBuffer, mode: u32) -> ::js_sys::Promise<::js_sys::Undefined>;
200 #[cfg(web_sys_unstable_apis)]
201 #[wasm_bindgen(method, js_class = "GPUBuffer", js_name = "mapAsync")]
202 #[doc = "The `mapAsync()` method."]
203 #[doc = ""]
204 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapAsync)"]
205 #[doc = ""]
206 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
207 #[doc = ""]
208 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
209 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
210 pub fn map_async_with_u32(
211 this: &GpuBuffer,
212 mode: u32,
213 offset: u32,
214 ) -> ::js_sys::Promise<::js_sys::Undefined>;
215 #[cfg(web_sys_unstable_apis)]
216 #[wasm_bindgen(method, js_class = "GPUBuffer", js_name = "mapAsync")]
217 #[doc = "The `mapAsync()` method."]
218 #[doc = ""]
219 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapAsync)"]
220 #[doc = ""]
221 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
222 #[doc = ""]
223 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
224 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
225 pub fn map_async_with_f64(
226 this: &GpuBuffer,
227 mode: u32,
228 offset: f64,
229 ) -> ::js_sys::Promise<::js_sys::Undefined>;
230 #[cfg(web_sys_unstable_apis)]
231 #[wasm_bindgen(method, js_class = "GPUBuffer", js_name = "mapAsync")]
232 #[doc = "The `mapAsync()` method."]
233 #[doc = ""]
234 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapAsync)"]
235 #[doc = ""]
236 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
237 #[doc = ""]
238 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
239 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
240 pub fn map_async_with_u32_and_u32(
241 this: &GpuBuffer,
242 mode: u32,
243 offset: u32,
244 size: u32,
245 ) -> ::js_sys::Promise<::js_sys::Undefined>;
246 #[cfg(web_sys_unstable_apis)]
247 #[wasm_bindgen(method, js_class = "GPUBuffer", js_name = "mapAsync")]
248 #[doc = "The `mapAsync()` method."]
249 #[doc = ""]
250 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapAsync)"]
251 #[doc = ""]
252 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
253 #[doc = ""]
254 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
255 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
256 pub fn map_async_with_f64_and_u32(
257 this: &GpuBuffer,
258 mode: u32,
259 offset: f64,
260 size: u32,
261 ) -> ::js_sys::Promise<::js_sys::Undefined>;
262 #[cfg(web_sys_unstable_apis)]
263 #[wasm_bindgen(method, js_class = "GPUBuffer", js_name = "mapAsync")]
264 #[doc = "The `mapAsync()` method."]
265 #[doc = ""]
266 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapAsync)"]
267 #[doc = ""]
268 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
269 #[doc = ""]
270 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
271 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
272 pub fn map_async_with_u32_and_f64(
273 this: &GpuBuffer,
274 mode: u32,
275 offset: u32,
276 size: f64,
277 ) -> ::js_sys::Promise<::js_sys::Undefined>;
278 #[cfg(web_sys_unstable_apis)]
279 #[wasm_bindgen(method, js_class = "GPUBuffer", js_name = "mapAsync")]
280 #[doc = "The `mapAsync()` method."]
281 #[doc = ""]
282 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/mapAsync)"]
283 #[doc = ""]
284 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
285 #[doc = ""]
286 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
287 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
288 pub fn map_async_with_f64_and_f64(
289 this: &GpuBuffer,
290 mode: u32,
291 offset: f64,
292 size: f64,
293 ) -> ::js_sys::Promise<::js_sys::Undefined>;
294 #[cfg(web_sys_unstable_apis)]
295 #[wasm_bindgen(method, js_class = "GPUBuffer")]
296 #[doc = "The `unmap()` method."]
297 #[doc = ""]
298 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUBuffer/unmap)"]
299 #[doc = ""]
300 #[doc = "*This API requires the following crate features to be activated: `GpuBuffer`*"]
301 #[doc = ""]
302 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
303 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
304 pub fn unmap(this: &GpuBuffer);
305}