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