web_sys/features/
gen_RtcSessionDescriptionInit.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 = RTCSessionDescriptionInit)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `RtcSessionDescriptionInit` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `RtcSessionDescriptionInit`*"]
12 pub type RtcSessionDescriptionInit;
13 #[doc = "Get the `sdp` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `RtcSessionDescriptionInit`*"]
16 #[wasm_bindgen(method, getter = "sdp")]
17 pub fn get_sdp(this: &RtcSessionDescriptionInit) -> Option<::alloc::string::String>;
18 #[doc = "Change the `sdp` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `RtcSessionDescriptionInit`*"]
21 #[wasm_bindgen(method, setter = "sdp")]
22 pub fn set_sdp(this: &RtcSessionDescriptionInit, val: &str);
23 #[cfg(feature = "RtcSdpType")]
24 #[doc = "Get the `type` field of this object."]
25 #[doc = ""]
26 #[doc = "*This API requires the following crate features to be activated: `RtcSdpType`, `RtcSessionDescriptionInit`*"]
27 #[wasm_bindgen(method, getter = "type")]
28 pub fn get_type(this: &RtcSessionDescriptionInit) -> RtcSdpType;
29 #[cfg(feature = "RtcSdpType")]
30 #[doc = "Change the `type` field of this object."]
31 #[doc = ""]
32 #[doc = "*This API requires the following crate features to be activated: `RtcSdpType`, `RtcSessionDescriptionInit`*"]
33 #[wasm_bindgen(method, setter = "type")]
34 pub fn set_type(this: &RtcSessionDescriptionInit, val: RtcSdpType);
35}
36impl RtcSessionDescriptionInit {
37 #[cfg(feature = "RtcSdpType")]
38 #[doc = "Construct a new `RtcSessionDescriptionInit`."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `RtcSdpType`, `RtcSessionDescriptionInit`*"]
41 pub fn new(type_: RtcSdpType) -> Self {
42 #[allow(unused_mut)]
43 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
44 ret.set_type(type_);
45 ret
46 }
47 #[deprecated = "Use `set_sdp()` instead."]
48 pub fn sdp(&mut self, val: &str) -> &mut Self {
49 self.set_sdp(val);
50 self
51 }
52 #[cfg(feature = "RtcSdpType")]
53 #[deprecated = "Use `set_type()` instead."]
54 pub fn type_(&mut self, val: RtcSdpType) -> &mut Self {
55 self.set_type(val);
56 self
57 }
58}