Skip to main content

web_sys/features/
gen_GpuBuffer.rs

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