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