web_sys/features/
gen_GpuBufferDescriptor.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 = GPUBufferDescriptor)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `GpuBufferDescriptor` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"]
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 GpuBufferDescriptor;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `label` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"]
21    #[doc = ""]
22    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
24    #[wasm_bindgen(method, getter = "label")]
25    pub fn get_label(this: &GpuBufferDescriptor) -> Option<::alloc::string::String>;
26    #[cfg(web_sys_unstable_apis)]
27    #[doc = "Change the `label` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
33    #[wasm_bindgen(method, setter = "label")]
34    pub fn set_label(this: &GpuBufferDescriptor, val: &str);
35    #[cfg(web_sys_unstable_apis)]
36    #[doc = "Get the `mappedAtCreation` field of this object."]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"]
39    #[doc = ""]
40    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
41    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
42    #[wasm_bindgen(method, getter = "mappedAtCreation")]
43    pub fn get_mapped_at_creation(this: &GpuBufferDescriptor) -> Option<bool>;
44    #[cfg(web_sys_unstable_apis)]
45    #[doc = "Change the `mappedAtCreation` field of this object."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"]
48    #[doc = ""]
49    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
50    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
51    #[wasm_bindgen(method, setter = "mappedAtCreation")]
52    pub fn set_mapped_at_creation(this: &GpuBufferDescriptor, val: bool);
53    #[cfg(web_sys_unstable_apis)]
54    #[doc = "Get the `size` field of this object."]
55    #[doc = ""]
56    #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"]
57    #[doc = ""]
58    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
59    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
60    #[wasm_bindgen(method, getter = "size")]
61    pub fn get_size(this: &GpuBufferDescriptor) -> f64;
62    #[cfg(web_sys_unstable_apis)]
63    #[doc = "Change the `size` field of this object."]
64    #[doc = ""]
65    #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"]
66    #[doc = ""]
67    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
68    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
69    #[wasm_bindgen(method, setter = "size")]
70    pub fn set_size(this: &GpuBufferDescriptor, val: f64);
71    #[cfg(web_sys_unstable_apis)]
72    #[doc = "Get the `usage` field of this object."]
73    #[doc = ""]
74    #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
78    #[wasm_bindgen(method, getter = "usage")]
79    pub fn get_usage(this: &GpuBufferDescriptor) -> u32;
80    #[cfg(web_sys_unstable_apis)]
81    #[doc = "Change the `usage` field of this object."]
82    #[doc = ""]
83    #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
87    #[wasm_bindgen(method, setter = "usage")]
88    pub fn set_usage(this: &GpuBufferDescriptor, val: u32);
89}
90#[cfg(web_sys_unstable_apis)]
91impl GpuBufferDescriptor {
92    #[doc = "Construct a new `GpuBufferDescriptor`."]
93    #[doc = ""]
94    #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
98    pub fn new(size: f64, usage: u32) -> Self {
99        #[allow(unused_mut)]
100        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
101        ret.set_size(size);
102        ret.set_usage(usage);
103        ret
104    }
105    #[cfg(web_sys_unstable_apis)]
106    #[deprecated = "Use `set_label()` instead."]
107    pub fn label(&mut self, val: &str) -> &mut Self {
108        self.set_label(val);
109        self
110    }
111    #[cfg(web_sys_unstable_apis)]
112    #[deprecated = "Use `set_mapped_at_creation()` instead."]
113    pub fn mapped_at_creation(&mut self, val: bool) -> &mut Self {
114        self.set_mapped_at_creation(val);
115        self
116    }
117    #[cfg(web_sys_unstable_apis)]
118    #[deprecated = "Use `set_size()` instead."]
119    pub fn size(&mut self, val: f64) -> &mut Self {
120        self.set_size(val);
121        self
122    }
123    #[cfg(web_sys_unstable_apis)]
124    #[deprecated = "Use `set_usage()` instead."]
125    pub fn usage(&mut self, val: u32) -> &mut Self {
126        self.set_usage(val);
127        self
128    }
129}