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