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