]>
Commit | Line | Data |
---|---|---|
49aad941 | 1 | #![allow(unused_imports)] |
fe692bf9 | 2 | #![allow(clippy::all)] |
49aad941 FG |
3 | use super::*; |
4 | use wasm_bindgen::prelude::*; | |
5 | #[wasm_bindgen] | |
6 | extern "C" { | |
7 | # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCConfiguration)] | |
8 | #[derive(Debug, Clone, PartialEq, Eq)] | |
9 | #[doc = "The `RtcConfiguration` dictionary."] | |
10 | #[doc = ""] | |
11 | #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] | |
12 | pub type RtcConfiguration; | |
13 | } | |
14 | impl RtcConfiguration { | |
15 | #[doc = "Construct a new `RtcConfiguration`."] | |
16 | #[doc = ""] | |
17 | #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] | |
18 | pub fn new() -> Self { | |
19 | #[allow(unused_mut)] | |
20 | let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); | |
21 | ret | |
22 | } | |
23 | #[cfg(feature = "RtcBundlePolicy")] | |
24 | #[doc = "Change the `bundlePolicy` field of this object."] | |
25 | #[doc = ""] | |
26 | #[doc = "*This API requires the following crate features to be activated: `RtcBundlePolicy`, `RtcConfiguration`*"] | |
27 | pub fn bundle_policy(&mut self, val: RtcBundlePolicy) -> &mut Self { | |
28 | use wasm_bindgen::JsValue; | |
29 | let r = ::js_sys::Reflect::set( | |
30 | self.as_ref(), | |
31 | &JsValue::from("bundlePolicy"), | |
32 | &JsValue::from(val), | |
33 | ); | |
34 | debug_assert!( | |
35 | r.is_ok(), | |
36 | "setting properties should never fail on our dictionary objects" | |
37 | ); | |
38 | let _ = r; | |
39 | self | |
40 | } | |
41 | #[doc = "Change the `certificates` field of this object."] | |
42 | #[doc = ""] | |
43 | #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] | |
44 | pub fn certificates(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { | |
45 | use wasm_bindgen::JsValue; | |
46 | let r = ::js_sys::Reflect::set( | |
47 | self.as_ref(), | |
48 | &JsValue::from("certificates"), | |
49 | &JsValue::from(val), | |
50 | ); | |
51 | debug_assert!( | |
52 | r.is_ok(), | |
53 | "setting properties should never fail on our dictionary objects" | |
54 | ); | |
55 | let _ = r; | |
56 | self | |
57 | } | |
58 | #[doc = "Change the `iceServers` field of this object."] | |
59 | #[doc = ""] | |
60 | #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] | |
61 | pub fn ice_servers(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { | |
62 | use wasm_bindgen::JsValue; | |
63 | let r = ::js_sys::Reflect::set( | |
64 | self.as_ref(), | |
65 | &JsValue::from("iceServers"), | |
66 | &JsValue::from(val), | |
67 | ); | |
68 | debug_assert!( | |
69 | r.is_ok(), | |
70 | "setting properties should never fail on our dictionary objects" | |
71 | ); | |
72 | let _ = r; | |
73 | self | |
74 | } | |
75 | #[cfg(feature = "RtcIceTransportPolicy")] | |
76 | #[doc = "Change the `iceTransportPolicy` field of this object."] | |
77 | #[doc = ""] | |
78 | #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`, `RtcIceTransportPolicy`*"] | |
79 | pub fn ice_transport_policy(&mut self, val: RtcIceTransportPolicy) -> &mut Self { | |
80 | use wasm_bindgen::JsValue; | |
81 | let r = ::js_sys::Reflect::set( | |
82 | self.as_ref(), | |
83 | &JsValue::from("iceTransportPolicy"), | |
84 | &JsValue::from(val), | |
85 | ); | |
86 | debug_assert!( | |
87 | r.is_ok(), | |
88 | "setting properties should never fail on our dictionary objects" | |
89 | ); | |
90 | let _ = r; | |
91 | self | |
92 | } | |
93 | #[doc = "Change the `peerIdentity` field of this object."] | |
94 | #[doc = ""] | |
95 | #[doc = "*This API requires the following crate features to be activated: `RtcConfiguration`*"] | |
96 | pub fn peer_identity(&mut self, val: Option<&str>) -> &mut Self { | |
97 | use wasm_bindgen::JsValue; | |
98 | let r = ::js_sys::Reflect::set( | |
99 | self.as_ref(), | |
100 | &JsValue::from("peerIdentity"), | |
101 | &JsValue::from(val), | |
102 | ); | |
103 | debug_assert!( | |
104 | r.is_ok(), | |
105 | "setting properties should never fail on our dictionary objects" | |
106 | ); | |
107 | let _ = r; | |
108 | self | |
109 | } | |
110 | } | |
111 | impl Default for RtcConfiguration { | |
112 | fn default() -> Self { | |
113 | Self::new() | |
114 | } | |
115 | } |