web_sys/features/
gen_RtcDataChannelInit.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCDataChannelInit)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `RtcDataChannelInit` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"]
12 pub type RtcDataChannelInit;
13 #[doc = "Get the `id` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"]
16 #[wasm_bindgen(method, getter = "id")]
17 pub fn get_id(this: &RtcDataChannelInit) -> Option<u16>;
18 #[doc = "Change the `id` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"]
21 #[wasm_bindgen(method, setter = "id")]
22 pub fn set_id(this: &RtcDataChannelInit, val: u16);
23 #[doc = "Get the `maxPacketLifeTime` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"]
26 #[wasm_bindgen(method, getter = "maxPacketLifeTime")]
27 pub fn get_max_packet_life_time(this: &RtcDataChannelInit) -> Option<u16>;
28 #[doc = "Change the `maxPacketLifeTime` field of this object."]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"]
31 #[wasm_bindgen(method, setter = "maxPacketLifeTime")]
32 pub fn set_max_packet_life_time(this: &RtcDataChannelInit, val: u16);
33 #[doc = "Get the `maxRetransmitTime` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"]
36 #[wasm_bindgen(method, getter = "maxRetransmitTime")]
37 pub fn get_max_retransmit_time(this: &RtcDataChannelInit) -> Option<u16>;
38 #[doc = "Change the `maxRetransmitTime` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"]
41 #[wasm_bindgen(method, setter = "maxRetransmitTime")]
42 pub fn set_max_retransmit_time(this: &RtcDataChannelInit, val: u16);
43 #[doc = "Get the `maxRetransmits` field of this object."]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"]
46 #[wasm_bindgen(method, getter = "maxRetransmits")]
47 pub fn get_max_retransmits(this: &RtcDataChannelInit) -> Option<u16>;
48 #[doc = "Change the `maxRetransmits` field of this object."]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"]
51 #[wasm_bindgen(method, setter = "maxRetransmits")]
52 pub fn set_max_retransmits(this: &RtcDataChannelInit, val: u16);
53 #[doc = "Get the `negotiated` field of this object."]
54 #[doc = ""]
55 #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"]
56 #[wasm_bindgen(method, getter = "negotiated")]
57 pub fn get_negotiated(this: &RtcDataChannelInit) -> Option<bool>;
58 #[doc = "Change the `negotiated` field of this object."]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"]
61 #[wasm_bindgen(method, setter = "negotiated")]
62 pub fn set_negotiated(this: &RtcDataChannelInit, val: bool);
63 #[doc = "Get the `ordered` field of this object."]
64 #[doc = ""]
65 #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"]
66 #[wasm_bindgen(method, getter = "ordered")]
67 pub fn get_ordered(this: &RtcDataChannelInit) -> Option<bool>;
68 #[doc = "Change the `ordered` field of this object."]
69 #[doc = ""]
70 #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"]
71 #[wasm_bindgen(method, setter = "ordered")]
72 pub fn set_ordered(this: &RtcDataChannelInit, val: bool);
73 #[doc = "Get the `protocol` field of this object."]
74 #[doc = ""]
75 #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"]
76 #[wasm_bindgen(method, getter = "protocol")]
77 pub fn get_protocol(this: &RtcDataChannelInit) -> Option<::alloc::string::String>;
78 #[doc = "Change the `protocol` field of this object."]
79 #[doc = ""]
80 #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"]
81 #[wasm_bindgen(method, setter = "protocol")]
82 pub fn set_protocol(this: &RtcDataChannelInit, val: &str);
83}
84impl RtcDataChannelInit {
85 #[doc = "Construct a new `RtcDataChannelInit`."]
86 #[doc = ""]
87 #[doc = "*This API requires the following crate features to be activated: `RtcDataChannelInit`*"]
88 pub fn new() -> Self {
89 #[allow(unused_mut)]
90 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
91 ret
92 }
93 #[deprecated = "Use `set_id()` instead."]
94 pub fn id(&mut self, val: u16) -> &mut Self {
95 self.set_id(val);
96 self
97 }
98 #[deprecated = "Use `set_max_packet_life_time()` instead."]
99 pub fn max_packet_life_time(&mut self, val: u16) -> &mut Self {
100 self.set_max_packet_life_time(val);
101 self
102 }
103 #[deprecated = "Use `set_max_retransmit_time()` instead."]
104 pub fn max_retransmit_time(&mut self, val: u16) -> &mut Self {
105 self.set_max_retransmit_time(val);
106 self
107 }
108 #[deprecated = "Use `set_max_retransmits()` instead."]
109 pub fn max_retransmits(&mut self, val: u16) -> &mut Self {
110 self.set_max_retransmits(val);
111 self
112 }
113 #[deprecated = "Use `set_negotiated()` instead."]
114 pub fn negotiated(&mut self, val: bool) -> &mut Self {
115 self.set_negotiated(val);
116 self
117 }
118 #[deprecated = "Use `set_ordered()` instead."]
119 pub fn ordered(&mut self, val: bool) -> &mut Self {
120 self.set_ordered(val);
121 self
122 }
123 #[deprecated = "Use `set_protocol()` instead."]
124 pub fn protocol(&mut self, val: &str) -> &mut Self {
125 self.set_protocol(val);
126 self
127 }
128}
129impl Default for RtcDataChannelInit {
130 fn default() -> Self {
131 Self::new()
132 }
133}