Skip to main content

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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
69    #[wasm_bindgen(method, setter = "size")]
70    pub fn set_size(this: &GpuBufferDescriptor, val: u32);
71    #[cfg(web_sys_unstable_apis)]
72    #[doc = "Change the `size` 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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
78    #[wasm_bindgen(method, setter = "size")]
79    pub fn set_size_f64(this: &GpuBufferDescriptor, val: f64);
80    #[cfg(web_sys_unstable_apis)]
81    #[doc = "Get 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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
87    #[wasm_bindgen(method, getter = "usage")]
88    pub fn get_usage(this: &GpuBufferDescriptor) -> u32;
89    #[cfg(web_sys_unstable_apis)]
90    #[doc = "Change the `usage` field of this object."]
91    #[doc = ""]
92    #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"]
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    #[wasm_bindgen(method, setter = "usage")]
97    pub fn set_usage(this: &GpuBufferDescriptor, val: u32);
98}
99#[cfg(web_sys_unstable_apis)]
100impl GpuBufferDescriptor {
101    #[doc = "Construct a new `GpuBufferDescriptor`."]
102    #[doc = ""]
103    #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"]
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 new(size: u32, usage: u32) -> Self {
108        #[allow(unused_mut)]
109        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
110        ret.set_size(size);
111        ret.set_usage(usage);
112        ret
113    }
114    #[doc = "Construct a new `GpuBufferDescriptor`."]
115    #[doc = ""]
116    #[doc = "*This API requires the following crate features to be activated: `GpuBufferDescriptor`*"]
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 new_with_f64(size: f64, usage: u32) -> Self {
121        #[allow(unused_mut)]
122        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
123        ret.set_size_f64(size);
124        ret.set_usage(usage);
125        ret
126    }
127    #[cfg(web_sys_unstable_apis)]
128    #[deprecated = "Use `set_label()` instead."]
129    pub fn label(&mut self, val: &str) -> &mut Self {
130        self.set_label(val);
131        self
132    }
133    #[cfg(web_sys_unstable_apis)]
134    #[deprecated = "Use `set_mapped_at_creation()` instead."]
135    pub fn mapped_at_creation(&mut self, val: bool) -> &mut Self {
136        self.set_mapped_at_creation(val);
137        self
138    }
139    #[cfg(web_sys_unstable_apis)]
140    #[deprecated = "Use `set_size()` instead."]
141    pub fn size(&mut self, val: u32) -> &mut Self {
142        self.set_size(val);
143        self
144    }
145    #[cfg(web_sys_unstable_apis)]
146    #[deprecated = "Use `set_usage()` instead."]
147    pub fn usage(&mut self, val: u32) -> &mut Self {
148        self.set_usage(val);
149        self
150    }
151}