Skip to main content

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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
41    pub fn alternate(this: &UsbInterface) -> UsbAlternateInterface;
42    #[cfg(web_sys_unstable_apis)]
43    #[cfg(feature = "UsbAlternateInterface")]
44    # [wasm_bindgen (structural , method , getter , js_class = "USBInterface" , js_name = alternates)]
45    #[doc = "Getter for the `alternates` field of this object."]
46    #[doc = ""]
47    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBInterface/alternates)"]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `UsbAlternateInterface`, `UsbInterface`*"]
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    pub fn alternates(this: &UsbInterface) -> ::js_sys::Array<UsbAlternateInterface>;
54    #[cfg(web_sys_unstable_apis)]
55    # [wasm_bindgen (structural , method , getter , js_class = "USBInterface" , js_name = claimed)]
56    #[doc = "Getter for the `claimed` field of this object."]
57    #[doc = ""]
58    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBInterface/claimed)"]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `UsbInterface`*"]
61    #[doc = ""]
62    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
63    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
64    pub fn claimed(this: &UsbInterface) -> bool;
65    #[cfg(web_sys_unstable_apis)]
66    #[cfg(feature = "UsbConfiguration")]
67    #[wasm_bindgen(catch, constructor, js_class = "USBInterface")]
68    #[doc = "The `new UsbInterface(..)` constructor, creating a new instance of `UsbInterface`."]
69    #[doc = ""]
70    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBInterface/USBInterface)"]
71    #[doc = ""]
72    #[doc = "*This API requires the following crate features to be activated: `UsbConfiguration`, `UsbInterface`*"]
73    #[doc = ""]
74    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
75    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
76    pub fn new(
77        configuration: &UsbConfiguration,
78        interface_number: u8,
79    ) -> Result<UsbInterface, JsValue>;
80}