web_sys/features/
gen_GpuDeviceDescriptor.rs1#![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 = GPUDeviceDescriptor)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `GpuDeviceDescriptor` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"]
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 GpuDeviceDescriptor;
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: `GpuDeviceDescriptor`*"]
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: &GpuDeviceDescriptor) -> 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: `GpuDeviceDescriptor`*"]
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: &GpuDeviceDescriptor, val: &str);
35 #[cfg(web_sys_unstable_apis)]
36 #[cfg(feature = "GpuQueueDescriptor")]
37 #[doc = "Get the `defaultQueue` field of this object."]
38 #[doc = ""]
39 #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`, `GpuQueueDescriptor`*"]
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 #[wasm_bindgen(method, getter = "defaultQueue")]
44 pub fn get_default_queue(this: &GpuDeviceDescriptor) -> Option<GpuQueueDescriptor>;
45 #[cfg(web_sys_unstable_apis)]
46 #[cfg(feature = "GpuQueueDescriptor")]
47 #[doc = "Change the `defaultQueue` field of this object."]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`, `GpuQueueDescriptor`*"]
50 #[doc = ""]
51 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
53 #[wasm_bindgen(method, setter = "defaultQueue")]
54 pub fn set_default_queue(this: &GpuDeviceDescriptor, val: &GpuQueueDescriptor);
55 #[cfg(web_sys_unstable_apis)]
56 #[doc = "Get the `requiredFeatures` field of this object."]
57 #[doc = ""]
58 #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"]
59 #[doc = ""]
60 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
61 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
62 #[wasm_bindgen(method, getter = "requiredFeatures")]
63 pub fn get_required_features(
64 this: &GpuDeviceDescriptor,
65 ) -> Option<::js_sys::Array<::js_sys::JsString>>;
66 #[cfg(web_sys_unstable_apis)]
67 #[doc = "Change the `requiredFeatures` field of this object."]
68 #[doc = ""]
69 #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"]
70 #[doc = ""]
71 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
72 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
73 #[wasm_bindgen(method, setter = "requiredFeatures")]
74 pub fn set_required_features(this: &GpuDeviceDescriptor, val: &[::js_sys::JsString]);
75 #[cfg(web_sys_unstable_apis)]
76 #[doc = "Get the `requiredLimits` field of this object."]
77 #[doc = ""]
78 #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"]
79 #[doc = ""]
80 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
81 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
82 #[wasm_bindgen(method, getter = "requiredLimits")]
83 pub fn get_required_limits(this: &GpuDeviceDescriptor) -> Option<::js_sys::Object>;
84 #[cfg(web_sys_unstable_apis)]
85 #[doc = "Change the `requiredLimits` field of this object."]
86 #[doc = ""]
87 #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"]
88 #[doc = ""]
89 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
90 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
91 #[wasm_bindgen(method, setter = "requiredLimits")]
92 pub fn set_required_limits(
93 this: &GpuDeviceDescriptor,
94 val: &::js_sys::Object<::js_sys::Number>,
95 );
96 #[cfg(web_sys_unstable_apis)]
97 #[doc = "Change the `requiredLimits` field of this object."]
98 #[doc = ""]
99 #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"]
100 #[doc = ""]
101 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
102 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
103 #[wasm_bindgen(method, setter = "requiredLimits")]
104 pub fn set_required_limits_record_from_str_to_f64(
105 this: &GpuDeviceDescriptor,
106 val: &::js_sys::Object<::js_sys::Number>,
107 );
108}
109#[cfg(web_sys_unstable_apis)]
110impl GpuDeviceDescriptor {
111 #[doc = "Construct a new `GpuDeviceDescriptor`."]
112 #[doc = ""]
113 #[doc = "*This API requires the following crate features to be activated: `GpuDeviceDescriptor`*"]
114 #[doc = ""]
115 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
116 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
117 pub fn new() -> Self {
118 #[allow(unused_mut)]
119 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
120 ret
121 }
122 #[cfg(web_sys_unstable_apis)]
123 #[deprecated = "Use `set_label()` instead."]
124 pub fn label(&mut self, val: &str) -> &mut Self {
125 self.set_label(val);
126 self
127 }
128 #[cfg(web_sys_unstable_apis)]
129 #[cfg(feature = "GpuQueueDescriptor")]
130 #[deprecated = "Use `set_default_queue()` instead."]
131 pub fn default_queue(&mut self, val: &GpuQueueDescriptor) -> &mut Self {
132 self.set_default_queue(val);
133 self
134 }
135 #[cfg(web_sys_unstable_apis)]
136 #[deprecated = "Use `set_required_features()` instead."]
137 pub fn required_features(&mut self, val: &[::js_sys::JsString]) -> &mut Self {
138 self.set_required_features(val);
139 self
140 }
141 #[cfg(web_sys_unstable_apis)]
142 #[deprecated = "Use `set_required_limits()` instead."]
143 pub fn required_limits(&mut self, val: &::js_sys::Object<::js_sys::Number>) -> &mut Self {
144 self.set_required_limits(val);
145 self
146 }
147}
148#[cfg(web_sys_unstable_apis)]
149impl Default for GpuDeviceDescriptor {
150 fn default() -> Self {
151 Self::new()
152 }
153}