web_sys/features/
gen_UsbInterface.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 = USBInterface , typescript_type = "USBInterface")]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `UsbInterface` class."]
11    #[doc = ""]
12    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBInterface)"]
13    #[doc = ""]
14    #[doc = "*This API requires the following crate features to be activated: `UsbInterface`*"]
15    #[doc = ""]
16    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
17    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
18    pub type UsbInterface;
19    #[cfg(web_sys_unstable_apis)]
20    # [wasm_bindgen (structural , method , getter , js_class = "USBInterface" , js_name = interfaceNumber)]
21    #[doc = "Getter for the `interfaceNumber` field of this object."]
22    #[doc = ""]
23    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBInterface/interfaceNumber)"]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `UsbInterface`*"]
26    #[doc = ""]
27    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
28    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
29    pub fn interface_number(this: &UsbInterface) -> u8;
30    #[cfg(web_sys_unstable_apis)]
31    #[cfg(feature = "UsbAlternateInterface")]
32    # [wasm_bindgen (structural , method , getter , js_class = "USBInterface" , js_name = alternate)]
33    #[doc = "Getter for the `alternate` field of this object."]
34    #[doc = ""]
35    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBInterface/alternate)"]
36    #[doc = ""]
37    #[doc = "*This API requires the following crate features to be activated: `UsbAlternateInterface`, `UsbInterface`*"]
38    #[doc = ""]
39    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
40    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
41    pub fn alternate(this: &UsbInterface) -> UsbAlternateInterface;
42    #[cfg(web_sys_unstable_apis)]
43    # [wasm_bindgen (structural , method , getter , js_class = "USBInterface" , js_name = alternates)]
44    #[doc = "Getter for the `alternates` field of this object."]
45    #[doc = ""]
46    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBInterface/alternates)"]
47    #[doc = ""]
48    #[doc = "*This API requires the following crate features to be activated: `UsbInterface`*"]
49    #[doc = ""]
50    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
51    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
52    pub fn alternates(this: &UsbInterface) -> ::js_sys::Array;
53    #[cfg(web_sys_unstable_apis)]
54    # [wasm_bindgen (structural , method , getter , js_class = "USBInterface" , js_name = claimed)]
55    #[doc = "Getter for the `claimed` field of this object."]
56    #[doc = ""]
57    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBInterface/claimed)"]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `UsbInterface`*"]
60    #[doc = ""]
61    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
62    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
63    pub fn claimed(this: &UsbInterface) -> bool;
64    #[cfg(web_sys_unstable_apis)]
65    #[cfg(feature = "UsbConfiguration")]
66    #[wasm_bindgen(catch, constructor, js_class = "USBInterface")]
67    #[doc = "The `new UsbInterface(..)` constructor, creating a new instance of `UsbInterface`."]
68    #[doc = ""]
69    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBInterface/USBInterface)"]
70    #[doc = ""]
71    #[doc = "*This API requires the following crate features to be activated: `UsbConfiguration`, `UsbInterface`*"]
72    #[doc = ""]
73    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
74    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
75    pub fn new(
76        configuration: &UsbConfiguration,
77        interface_number: u8,
78    ) -> Result<UsbInterface, JsValue>;
79}