Skip to main content

web_sys/features/
gen_UsbEndpoint.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 = "USBEndpoint",
11        typescript_type = "USBEndpoint"
12    )]
13    #[derive(Debug, Clone, PartialEq, Eq)]
14    #[doc = "The `UsbEndpoint` class."]
15    #[doc = ""]
16    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBEndpoint)"]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `UsbEndpoint`*"]
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 UsbEndpoint;
23    #[cfg(web_sys_unstable_apis)]
24    #[wasm_bindgen(method, getter, js_class = "USBEndpoint", js_name = "endpointNumber")]
25    #[doc = "Getter for the `endpointNumber` field of this object."]
26    #[doc = ""]
27    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBEndpoint/endpointNumber)"]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `UsbEndpoint`*"]
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 endpoint_number(this: &UsbEndpoint) -> u8;
34    #[cfg(web_sys_unstable_apis)]
35    #[cfg(feature = "UsbDirection")]
36    #[wasm_bindgen(method, getter, js_class = "USBEndpoint", js_name = "direction")]
37    #[doc = "Getter for the `direction` field of this object."]
38    #[doc = ""]
39    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBEndpoint/direction)"]
40    #[doc = ""]
41    #[doc = "*This API requires the following crate features to be activated: `UsbDirection`, `UsbEndpoint`*"]
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 direction(this: &UsbEndpoint) -> UsbDirection;
46    #[cfg(web_sys_unstable_apis)]
47    #[cfg(feature = "UsbEndpointType")]
48    #[wasm_bindgen(method, getter, js_class = "USBEndpoint", js_name = "type")]
49    #[doc = "Getter for the `type` field of this object."]
50    #[doc = ""]
51    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBEndpoint/type)"]
52    #[doc = ""]
53    #[doc = "*This API requires the following crate features to be activated: `UsbEndpoint`, `UsbEndpointType`*"]
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 type_(this: &UsbEndpoint) -> UsbEndpointType;
58    #[cfg(web_sys_unstable_apis)]
59    #[wasm_bindgen(method, getter, js_class = "USBEndpoint", js_name = "packetSize")]
60    #[doc = "Getter for the `packetSize` field of this object."]
61    #[doc = ""]
62    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBEndpoint/packetSize)"]
63    #[doc = ""]
64    #[doc = "*This API requires the following crate features to be activated: `UsbEndpoint`*"]
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 packet_size(this: &UsbEndpoint) -> u32;
69    #[cfg(web_sys_unstable_apis)]
70    #[cfg(all(feature = "UsbAlternateInterface", feature = "UsbDirection",))]
71    #[wasm_bindgen(catch, constructor, js_class = "USBEndpoint")]
72    #[doc = "The `new UsbEndpoint(..)` constructor, creating a new instance of `UsbEndpoint`."]
73    #[doc = ""]
74    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/USBEndpoint/USBEndpoint)"]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `UsbAlternateInterface`, `UsbDirection`, `UsbEndpoint`*"]
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        alternate: &UsbAlternateInterface,
82        endpoint_number: u8,
83        direction: UsbDirection,
84    ) -> Result<UsbEndpoint, JsValue>;
85}