Skip to main content

web_sys/features/
gen_RtcDataChannel.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "EventTarget",
9        extends = "::js_sys::Object",
10        js_name = "RTCDataChannel",
11        typescript_type = "RTCDataChannel"
12    )]
13    #[derive(Debug, Clone, PartialEq, Eq)]
14    #[doc = "The `RtcDataChannel` class."]
15    #[doc = ""]
16    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel)"]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
19    pub type RtcDataChannel;
20    #[wasm_bindgen(method, getter, js_class = "RTCDataChannel", js_name = "label")]
21    #[doc = "Getter for the `label` field of this object."]
22    #[doc = ""]
23    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/label)"]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
26    pub fn label(this: &RtcDataChannel) -> ::alloc::string::String;
27    #[wasm_bindgen(method, getter, js_class = "RTCDataChannel", js_name = "id")]
28    #[doc = "Getter for the `id` field of this object."]
29    #[doc = ""]
30    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/id)"]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
33    pub fn id(this: &RtcDataChannel) -> Option<u16>;
34    #[wasm_bindgen(method, getter, js_class = "RTCDataChannel", js_name = "reliable")]
35    #[doc = "Getter for the `reliable` field of this object."]
36    #[doc = ""]
37    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/reliable)"]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
40    pub fn reliable(this: &RtcDataChannel) -> bool;
41    #[wasm_bindgen(
42        method,
43        getter,
44        js_class = "RTCDataChannel",
45        js_name = "maxPacketLifeTime"
46    )]
47    #[doc = "Getter for the `maxPacketLifeTime` field of this object."]
48    #[doc = ""]
49    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/maxPacketLifeTime)"]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
52    pub fn max_packet_life_time(this: &RtcDataChannel) -> Option<u16>;
53    #[wasm_bindgen(
54        method,
55        getter,
56        js_class = "RTCDataChannel",
57        js_name = "maxRetransmits"
58    )]
59    #[doc = "Getter for the `maxRetransmits` field of this object."]
60    #[doc = ""]
61    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/maxRetransmits)"]
62    #[doc = ""]
63    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
64    pub fn max_retransmits(this: &RtcDataChannel) -> Option<u16>;
65    #[cfg(feature = "RtcDataChannelState")]
66    #[wasm_bindgen(method, getter, js_class = "RTCDataChannel", js_name = "readyState")]
67    #[doc = "Getter for the `readyState` field of this object."]
68    #[doc = ""]
69    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/readyState)"]
70    #[doc = ""]
71    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelState`*"]
72    pub fn ready_state(this: &RtcDataChannel) -> RtcDataChannelState;
73    #[wasm_bindgen(
74        method,
75        getter,
76        js_class = "RTCDataChannel",
77        js_name = "bufferedAmount"
78    )]
79    #[doc = "Getter for the `bufferedAmount` field of this object."]
80    #[doc = ""]
81    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmount)"]
82    #[doc = ""]
83    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
84    pub fn buffered_amount(this: &RtcDataChannel) -> u32;
85    #[wasm_bindgen(
86        method,
87        getter,
88        js_class = "RTCDataChannel",
89        js_name = "bufferedAmountLowThreshold"
90    )]
91    #[doc = "Getter for the `bufferedAmountLowThreshold` field of this object."]
92    #[doc = ""]
93    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmountLowThreshold)"]
94    #[doc = ""]
95    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
96    pub fn buffered_amount_low_threshold(this: &RtcDataChannel) -> u32;
97    #[wasm_bindgen(
98        method,
99        setter,
100        js_class = "RTCDataChannel",
101        js_name = "bufferedAmountLowThreshold"
102    )]
103    #[doc = "Setter for the `bufferedAmountLowThreshold` field of this object."]
104    #[doc = ""]
105    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/bufferedAmountLowThreshold)"]
106    #[doc = ""]
107    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
108    pub fn set_buffered_amount_low_threshold(this: &RtcDataChannel, value: u32);
109    #[wasm_bindgen(method, getter, js_class = "RTCDataChannel", js_name = "onopen")]
110    #[doc = "Getter for the `onopen` field of this object."]
111    #[doc = ""]
112    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onopen)"]
113    #[doc = ""]
114    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
115    pub fn onopen(this: &RtcDataChannel) -> Option<::js_sys::Function>;
116    #[wasm_bindgen(method, setter, js_class = "RTCDataChannel", js_name = "onopen")]
117    #[doc = "Setter for the `onopen` field of this object."]
118    #[doc = ""]
119    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onopen)"]
120    #[doc = ""]
121    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
122    pub fn set_onopen(this: &RtcDataChannel, value: Option<&::js_sys::Function>);
123    #[wasm_bindgen(method, getter, js_class = "RTCDataChannel", js_name = "onerror")]
124    #[doc = "Getter for the `onerror` field of this object."]
125    #[doc = ""]
126    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onerror)"]
127    #[doc = ""]
128    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
129    pub fn onerror(this: &RtcDataChannel) -> Option<::js_sys::Function>;
130    #[wasm_bindgen(method, setter, js_class = "RTCDataChannel", js_name = "onerror")]
131    #[doc = "Setter for the `onerror` field of this object."]
132    #[doc = ""]
133    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onerror)"]
134    #[doc = ""]
135    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
136    pub fn set_onerror(this: &RtcDataChannel, value: Option<&::js_sys::Function>);
137    #[wasm_bindgen(method, getter, js_class = "RTCDataChannel", js_name = "onclose")]
138    #[doc = "Getter for the `onclose` field of this object."]
139    #[doc = ""]
140    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onclose)"]
141    #[doc = ""]
142    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
143    pub fn onclose(this: &RtcDataChannel) -> Option<::js_sys::Function>;
144    #[wasm_bindgen(method, setter, js_class = "RTCDataChannel", js_name = "onclose")]
145    #[doc = "Setter for the `onclose` field of this object."]
146    #[doc = ""]
147    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onclose)"]
148    #[doc = ""]
149    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
150    pub fn set_onclose(this: &RtcDataChannel, value: Option<&::js_sys::Function>);
151    #[wasm_bindgen(method, getter, js_class = "RTCDataChannel", js_name = "onmessage")]
152    #[doc = "Getter for the `onmessage` field of this object."]
153    #[doc = ""]
154    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onmessage)"]
155    #[doc = ""]
156    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
157    pub fn onmessage(this: &RtcDataChannel) -> Option<::js_sys::Function>;
158    #[wasm_bindgen(method, setter, js_class = "RTCDataChannel", js_name = "onmessage")]
159    #[doc = "Setter for the `onmessage` field of this object."]
160    #[doc = ""]
161    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onmessage)"]
162    #[doc = ""]
163    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
164    pub fn set_onmessage(this: &RtcDataChannel, value: Option<&::js_sys::Function>);
165    #[wasm_bindgen(
166        method,
167        getter,
168        js_class = "RTCDataChannel",
169        js_name = "onbufferedamountlow"
170    )]
171    #[doc = "Getter for the `onbufferedamountlow` field of this object."]
172    #[doc = ""]
173    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onbufferedamountlow)"]
174    #[doc = ""]
175    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
176    pub fn onbufferedamountlow(this: &RtcDataChannel) -> Option<::js_sys::Function>;
177    #[wasm_bindgen(
178        method,
179        setter,
180        js_class = "RTCDataChannel",
181        js_name = "onbufferedamountlow"
182    )]
183    #[doc = "Setter for the `onbufferedamountlow` field of this object."]
184    #[doc = ""]
185    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/onbufferedamountlow)"]
186    #[doc = ""]
187    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
188    pub fn set_onbufferedamountlow(this: &RtcDataChannel, value: Option<&::js_sys::Function>);
189    #[cfg(feature = "RtcDataChannelType")]
190    #[wasm_bindgen(method, getter, js_class = "RTCDataChannel", js_name = "binaryType")]
191    #[doc = "Getter for the `binaryType` field of this object."]
192    #[doc = ""]
193    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/binaryType)"]
194    #[doc = ""]
195    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelType`*"]
196    pub fn binary_type(this: &RtcDataChannel) -> RtcDataChannelType;
197    #[cfg(feature = "RtcDataChannelType")]
198    #[wasm_bindgen(method, setter, js_class = "RTCDataChannel", js_name = "binaryType")]
199    #[doc = "Setter for the `binaryType` field of this object."]
200    #[doc = ""]
201    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/binaryType)"]
202    #[doc = ""]
203    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`, `RtcDataChannelType`*"]
204    pub fn set_binary_type(this: &RtcDataChannel, value: RtcDataChannelType);
205    #[wasm_bindgen(method, js_class = "RTCDataChannel")]
206    #[doc = "The `close()` method."]
207    #[doc = ""]
208    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/close)"]
209    #[doc = ""]
210    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
211    pub fn close(this: &RtcDataChannel);
212    #[wasm_bindgen(catch, method, js_class = "RTCDataChannel", js_name = "send")]
213    #[doc = "The `send()` method."]
214    #[doc = ""]
215    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"]
216    #[doc = ""]
217    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
218    pub fn send_with_str(this: &RtcDataChannel, data: &str) -> Result<(), JsValue>;
219    #[cfg(feature = "Blob")]
220    #[wasm_bindgen(catch, method, js_class = "RTCDataChannel", js_name = "send")]
221    #[doc = "The `send()` method."]
222    #[doc = ""]
223    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"]
224    #[doc = ""]
225    #[doc = "*This API requires the following crate features to be activated: `Blob`, `RtcDataChannel`*"]
226    pub fn send_with_blob(this: &RtcDataChannel, data: &Blob) -> Result<(), JsValue>;
227    #[wasm_bindgen(catch, method, js_class = "RTCDataChannel", js_name = "send")]
228    #[doc = "The `send()` method."]
229    #[doc = ""]
230    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"]
231    #[doc = ""]
232    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
233    pub fn send_with_array_buffer(
234        this: &RtcDataChannel,
235        data: &::js_sys::ArrayBuffer,
236    ) -> Result<(), JsValue>;
237    #[wasm_bindgen(catch, method, js_class = "RTCDataChannel", js_name = "send")]
238    #[doc = "The `send()` method."]
239    #[doc = ""]
240    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"]
241    #[doc = ""]
242    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
243    pub fn send_with_array_buffer_view(
244        this: &RtcDataChannel,
245        data: &::js_sys::Object,
246    ) -> Result<(), JsValue>;
247    #[wasm_bindgen(catch, method, js_class = "RTCDataChannel", js_name = "send")]
248    #[doc = "The `send()` method."]
249    #[doc = ""]
250    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"]
251    #[doc = ""]
252    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
253    pub fn send_with_u8_array(this: &RtcDataChannel, data: &[u8]) -> Result<(), JsValue>;
254    #[wasm_bindgen(catch, method, js_class = "RTCDataChannel", js_name = "send")]
255    #[doc = "The `send()` method."]
256    #[doc = ""]
257    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/send)"]
258    #[doc = ""]
259    #[doc = "*This API requires the following crate features to be activated: `RtcDataChannel`*"]
260    pub fn send_with_js_u8_array(
261        this: &RtcDataChannel,
262        data: &::js_sys::Uint8Array,
263    ) -> Result<(), JsValue>;
264}