web_sys/features/
gen_RtcIceCandidateInit.rs

1#![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 = RTCIceCandidateInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `RtcIceCandidateInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"]
12    pub type RtcIceCandidateInit;
13    #[doc = "Get the `candidate` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"]
16    #[wasm_bindgen(method, getter = "candidate")]
17    pub fn get_candidate(this: &RtcIceCandidateInit) -> ::alloc::string::String;
18    #[doc = "Change the `candidate` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"]
21    #[wasm_bindgen(method, setter = "candidate")]
22    pub fn set_candidate(this: &RtcIceCandidateInit, val: &str);
23    #[doc = "Get the `sdpMLineIndex` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"]
26    #[wasm_bindgen(method, getter = "sdpMLineIndex")]
27    pub fn get_sdp_m_line_index(this: &RtcIceCandidateInit) -> Option<u16>;
28    #[doc = "Change the `sdpMLineIndex` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"]
31    #[wasm_bindgen(method, setter = "sdpMLineIndex")]
32    pub fn set_sdp_m_line_index(this: &RtcIceCandidateInit, val: Option<u16>);
33    #[doc = "Get the `sdpMid` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"]
36    #[wasm_bindgen(method, getter = "sdpMid")]
37    pub fn get_sdp_mid(this: &RtcIceCandidateInit) -> Option<::alloc::string::String>;
38    #[doc = "Change the `sdpMid` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"]
41    #[wasm_bindgen(method, setter = "sdpMid")]
42    pub fn set_sdp_mid(this: &RtcIceCandidateInit, val: Option<&str>);
43}
44impl RtcIceCandidateInit {
45    #[doc = "Construct a new `RtcIceCandidateInit`."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `RtcIceCandidateInit`*"]
48    pub fn new(candidate: &str) -> Self {
49        #[allow(unused_mut)]
50        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
51        ret.set_candidate(candidate);
52        ret
53    }
54    #[deprecated = "Use `set_candidate()` instead."]
55    pub fn candidate(&mut self, val: &str) -> &mut Self {
56        self.set_candidate(val);
57        self
58    }
59    #[deprecated = "Use `set_sdp_m_line_index()` instead."]
60    pub fn sdp_m_line_index(&mut self, val: Option<u16>) -> &mut Self {
61        self.set_sdp_m_line_index(val);
62        self
63    }
64    #[deprecated = "Use `set_sdp_mid()` instead."]
65    pub fn sdp_mid(&mut self, val: Option<&str>) -> &mut Self {
66        self.set_sdp_mid(val);
67        self
68    }
69}