Skip to main content

web_sys/features/
gen_GpuAdapter.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(
9        extends = "::js_sys::Object",
10        js_name = "GPUAdapter",
11        typescript_type = "GPUAdapter"
12    )]
13    #[derive(Debug, Clone, PartialEq, Eq)]
14    #[doc = "The `GpuAdapter` class."]
15    #[doc = ""]
16    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter)"]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`*"]
19    #[doc = ""]
20    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
21    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
22    pub type GpuAdapter;
23    #[cfg(web_sys_unstable_apis)]
24    #[cfg(feature = "GpuSupportedFeatures")]
25    #[wasm_bindgen(method, getter, js_class = "GPUAdapter", js_name = "features")]
26    #[doc = "Getter for the `features` field of this object."]
27    #[doc = ""]
28    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/features)"]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`, `GpuSupportedFeatures`*"]
31    #[doc = ""]
32    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
33    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
34    pub fn features(this: &GpuAdapter) -> GpuSupportedFeatures;
35    #[cfg(web_sys_unstable_apis)]
36    #[cfg(feature = "GpuSupportedLimits")]
37    #[wasm_bindgen(method, getter, js_class = "GPUAdapter", js_name = "limits")]
38    #[doc = "Getter for the `limits` field of this object."]
39    #[doc = ""]
40    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/limits)"]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`, `GpuSupportedLimits`*"]
43    #[doc = ""]
44    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
45    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
46    pub fn limits(this: &GpuAdapter) -> GpuSupportedLimits;
47    #[cfg(web_sys_unstable_apis)]
48    #[cfg(feature = "GpuAdapterInfo")]
49    #[wasm_bindgen(method, getter, js_class = "GPUAdapter", js_name = "info")]
50    #[doc = "Getter for the `info` field of this object."]
51    #[doc = ""]
52    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/info)"]
53    #[doc = ""]
54    #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`, `GpuAdapterInfo`*"]
55    #[doc = ""]
56    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
57    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
58    pub fn info(this: &GpuAdapter) -> GpuAdapterInfo;
59    #[cfg(web_sys_unstable_apis)]
60    #[cfg(feature = "GpuDevice")]
61    #[wasm_bindgen(method, js_class = "GPUAdapter", js_name = "requestDevice")]
62    #[doc = "The `requestDevice()` method."]
63    #[doc = ""]
64    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/requestDevice)"]
65    #[doc = ""]
66    #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`, `GpuDevice`*"]
67    #[doc = ""]
68    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
69    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
70    pub fn request_device(this: &GpuAdapter) -> ::js_sys::Promise<GpuDevice>;
71    #[cfg(web_sys_unstable_apis)]
72    #[cfg(all(feature = "GpuDevice", feature = "GpuDeviceDescriptor",))]
73    #[wasm_bindgen(method, js_class = "GPUAdapter", js_name = "requestDevice")]
74    #[doc = "The `requestDevice()` method."]
75    #[doc = ""]
76    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/requestDevice)"]
77    #[doc = ""]
78    #[doc = "*This API requires the following crate features to be activated: `GpuAdapter`, `GpuDevice`, `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    pub fn request_device_with_descriptor(
83        this: &GpuAdapter,
84        descriptor: &GpuDeviceDescriptor,
85    ) -> ::js_sys::Promise<GpuDevice>;
86}