web_sys/features/
gen_UsbConfiguration.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(
9 extends = "::js_sys::Object",
10 js_name = "USBConfiguration",
11 typescript_type = "USBConfiguration"
12 )]
13 #[derive(Debug, Clone, PartialEq, Eq)]
14 #[doc = "The `UsbConfiguration` class."]
15 #[doc = ""]
16 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBConfiguration)"]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `UsbConfiguration`*"]
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 UsbConfiguration;
23 #[cfg(web_sys_unstable_apis)]
24 #[wasm_bindgen(
25 method,
26 getter,
27 js_class = "USBConfiguration",
28 js_name = "configurationValue"
29 )]
30 #[doc = "Getter for the `configurationValue` field of this object."]
31 #[doc = ""]
32 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBConfiguration/configurationValue)"]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `UsbConfiguration`*"]
35 #[doc = ""]
36 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
37 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
38 pub fn configuration_value(this: &UsbConfiguration) -> u8;
39 #[cfg(web_sys_unstable_apis)]
40 #[wasm_bindgen(
41 method,
42 getter,
43 js_class = "USBConfiguration",
44 js_name = "configurationName"
45 )]
46 #[doc = "Getter for the `configurationName` field of this object."]
47 #[doc = ""]
48 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBConfiguration/configurationName)"]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `UsbConfiguration`*"]
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 configuration_name(this: &UsbConfiguration) -> Option<::alloc::string::String>;
55 #[cfg(web_sys_unstable_apis)]
56 #[cfg(feature = "UsbInterface")]
57 #[wasm_bindgen(method, getter, js_class = "USBConfiguration", js_name = "interfaces")]
58 #[doc = "Getter for the `interfaces` field of this object."]
59 #[doc = ""]
60 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBConfiguration/interfaces)"]
61 #[doc = ""]
62 #[doc = "*This API requires the following crate features to be activated: `UsbConfiguration`, `UsbInterface`*"]
63 #[doc = ""]
64 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
65 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
66 pub fn interfaces(this: &UsbConfiguration) -> ::js_sys::Array<UsbInterface>;
67 #[cfg(web_sys_unstable_apis)]
68 #[cfg(feature = "UsbDevice")]
69 #[wasm_bindgen(catch, constructor, js_class = "USBConfiguration")]
70 #[doc = "The `new UsbConfiguration(..)` constructor, creating a new instance of `UsbConfiguration`."]
71 #[doc = ""]
72 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBConfiguration/USBConfiguration)"]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `UsbConfiguration`, `UsbDevice`*"]
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 pub fn new(device: &UsbDevice, configuration_value: u8) -> Result<UsbConfiguration, JsValue>;
79}