web_sys/features/
gen_UsbControlTransferParameters.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 (extends = :: js_sys :: Object , js_name = USBControlTransferParameters)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `UsbControlTransferParameters` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`*"]
13 #[doc = ""]
14 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
16 pub type UsbControlTransferParameters;
17 #[cfg(web_sys_unstable_apis)]
18 #[doc = "Get the `index` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`*"]
21 #[doc = ""]
22 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
24 #[wasm_bindgen(method, getter = "index")]
25 pub fn get_index(this: &UsbControlTransferParameters) -> u16;
26 #[cfg(web_sys_unstable_apis)]
27 #[doc = "Change the `index` field of this object."]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
33 #[wasm_bindgen(method, setter = "index")]
34 pub fn set_index(this: &UsbControlTransferParameters, val: u16);
35 #[cfg(web_sys_unstable_apis)]
36 #[cfg(feature = "UsbRecipient")]
37 #[doc = "Get the `recipient` field of this object."]
38 #[doc = ""]
39 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`, `UsbRecipient`*"]
40 #[doc = ""]
41 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
42 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
43 #[wasm_bindgen(method, getter = "recipient")]
44 pub fn get_recipient(this: &UsbControlTransferParameters) -> UsbRecipient;
45 #[cfg(web_sys_unstable_apis)]
46 #[cfg(feature = "UsbRecipient")]
47 #[doc = "Change the `recipient` field of this object."]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`, `UsbRecipient`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
53 #[wasm_bindgen(method, setter = "recipient")]
54 pub fn set_recipient(this: &UsbControlTransferParameters, val: UsbRecipient);
55 #[cfg(web_sys_unstable_apis)]
56 #[doc = "Get the `request` field of this object."]
57 #[doc = ""]
58 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`*"]
59 #[doc = ""]
60 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
61 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
62 #[wasm_bindgen(method, getter = "request")]
63 pub fn get_request(this: &UsbControlTransferParameters) -> u8;
64 #[cfg(web_sys_unstable_apis)]
65 #[doc = "Change the `request` field of this object."]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`*"]
68 #[doc = ""]
69 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
70 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
71 #[wasm_bindgen(method, setter = "request")]
72 pub fn set_request(this: &UsbControlTransferParameters, val: u8);
73 #[cfg(web_sys_unstable_apis)]
74 #[cfg(feature = "UsbRequestType")]
75 #[doc = "Get the `requestType` field of this object."]
76 #[doc = ""]
77 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`, `UsbRequestType`*"]
78 #[doc = ""]
79 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
80 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
81 #[wasm_bindgen(method, getter = "requestType")]
82 pub fn get_request_type(this: &UsbControlTransferParameters) -> UsbRequestType;
83 #[cfg(web_sys_unstable_apis)]
84 #[cfg(feature = "UsbRequestType")]
85 #[doc = "Change the `requestType` field of this object."]
86 #[doc = ""]
87 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`, `UsbRequestType`*"]
88 #[doc = ""]
89 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
90 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
91 #[wasm_bindgen(method, setter = "requestType")]
92 pub fn set_request_type(this: &UsbControlTransferParameters, val: UsbRequestType);
93 #[cfg(web_sys_unstable_apis)]
94 #[doc = "Get the `value` field of this object."]
95 #[doc = ""]
96 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`*"]
97 #[doc = ""]
98 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
99 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
100 #[wasm_bindgen(method, getter = "value")]
101 pub fn get_value(this: &UsbControlTransferParameters) -> u16;
102 #[cfg(web_sys_unstable_apis)]
103 #[doc = "Change the `value` field of this object."]
104 #[doc = ""]
105 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`*"]
106 #[doc = ""]
107 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
108 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
109 #[wasm_bindgen(method, setter = "value")]
110 pub fn set_value(this: &UsbControlTransferParameters, val: u16);
111}
112#[cfg(web_sys_unstable_apis)]
113impl UsbControlTransferParameters {
114 #[cfg(all(feature = "UsbRecipient", feature = "UsbRequestType",))]
115 #[doc = "Construct a new `UsbControlTransferParameters`."]
116 #[doc = ""]
117 #[doc = "*This API requires the following crate features to be activated: `UsbControlTransferParameters`, `UsbRecipient`, `UsbRequestType`*"]
118 #[doc = ""]
119 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
120 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
121 pub fn new(
122 index: u16,
123 recipient: UsbRecipient,
124 request: u8,
125 request_type: UsbRequestType,
126 value: u16,
127 ) -> Self {
128 #[allow(unused_mut)]
129 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
130 ret.set_index(index);
131 ret.set_recipient(recipient);
132 ret.set_request(request);
133 ret.set_request_type(request_type);
134 ret.set_value(value);
135 ret
136 }
137 #[cfg(web_sys_unstable_apis)]
138 #[deprecated = "Use `set_index()` instead."]
139 pub fn index(&mut self, val: u16) -> &mut Self {
140 self.set_index(val);
141 self
142 }
143 #[cfg(web_sys_unstable_apis)]
144 #[cfg(feature = "UsbRecipient")]
145 #[deprecated = "Use `set_recipient()` instead."]
146 pub fn recipient(&mut self, val: UsbRecipient) -> &mut Self {
147 self.set_recipient(val);
148 self
149 }
150 #[cfg(web_sys_unstable_apis)]
151 #[deprecated = "Use `set_request()` instead."]
152 pub fn request(&mut self, val: u8) -> &mut Self {
153 self.set_request(val);
154 self
155 }
156 #[cfg(web_sys_unstable_apis)]
157 #[cfg(feature = "UsbRequestType")]
158 #[deprecated = "Use `set_request_type()` instead."]
159 pub fn request_type(&mut self, val: UsbRequestType) -> &mut Self {
160 self.set_request_type(val);
161 self
162 }
163 #[cfg(web_sys_unstable_apis)]
164 #[deprecated = "Use `set_value()` instead."]
165 pub fn value(&mut self, val: u16) -> &mut Self {
166 self.set_value(val);
167 self
168 }
169}