Skip to main content

web_sys/features/
gen_RtcrtpContributingSourceStats.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "::js_sys::Object",
9        js_name = "RTCRTPContributingSourceStats"
10    )]
11    #[derive(Debug, Clone, PartialEq, Eq)]
12    #[doc = "The `RtcrtpContributingSourceStats` dictionary."]
13    #[doc = ""]
14    #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"]
15    pub type RtcrtpContributingSourceStats;
16    #[doc = "Get the `id` field of this object."]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"]
19    #[wasm_bindgen(method, getter = "id")]
20    pub fn get_id(this: &RtcrtpContributingSourceStats) -> Option<::alloc::string::String>;
21    #[doc = "Change the `id` field of this object."]
22    #[doc = ""]
23    #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"]
24    #[wasm_bindgen(method, setter = "id")]
25    pub fn set_id(this: &RtcrtpContributingSourceStats, val: &str);
26    #[doc = "Get the `timestamp` field of this object."]
27    #[doc = ""]
28    #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"]
29    #[wasm_bindgen(method, getter = "timestamp")]
30    pub fn get_timestamp(this: &RtcrtpContributingSourceStats) -> Option<f64>;
31    #[doc = "Change the `timestamp` field of this object."]
32    #[doc = ""]
33    #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"]
34    #[wasm_bindgen(method, setter = "timestamp")]
35    pub fn set_timestamp(this: &RtcrtpContributingSourceStats, val: f64);
36    #[cfg(feature = "RtcStatsType")]
37    #[doc = "Get the `type` field of this object."]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `RtcStatsType`, `RtcrtpContributingSourceStats`*"]
40    #[wasm_bindgen(method, getter = "type")]
41    pub fn get_type(this: &RtcrtpContributingSourceStats) -> Option<RtcStatsType>;
42    #[cfg(feature = "RtcStatsType")]
43    #[doc = "Change the `type` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `RtcStatsType`, `RtcrtpContributingSourceStats`*"]
46    #[wasm_bindgen(method, setter = "type")]
47    pub fn set_type(this: &RtcrtpContributingSourceStats, val: RtcStatsType);
48    #[doc = "Get the `contributorSsrc` field of this object."]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"]
51    #[wasm_bindgen(method, getter = "contributorSsrc")]
52    pub fn get_contributor_ssrc(this: &RtcrtpContributingSourceStats) -> Option<u32>;
53    #[doc = "Change the `contributorSsrc` field of this object."]
54    #[doc = ""]
55    #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"]
56    #[wasm_bindgen(method, setter = "contributorSsrc")]
57    pub fn set_contributor_ssrc(this: &RtcrtpContributingSourceStats, val: u32);
58    #[doc = "Get the `inboundRtpStreamId` field of this object."]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"]
61    #[wasm_bindgen(method, getter = "inboundRtpStreamId")]
62    pub fn get_inbound_rtp_stream_id(
63        this: &RtcrtpContributingSourceStats,
64    ) -> Option<::alloc::string::String>;
65    #[doc = "Change the `inboundRtpStreamId` field of this object."]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"]
68    #[wasm_bindgen(method, setter = "inboundRtpStreamId")]
69    pub fn set_inbound_rtp_stream_id(this: &RtcrtpContributingSourceStats, val: &str);
70}
71impl RtcrtpContributingSourceStats {
72    #[doc = "Construct a new `RtcrtpContributingSourceStats`."]
73    #[doc = ""]
74    #[doc = "*This API requires the following crate features to be activated: `RtcrtpContributingSourceStats`*"]
75    pub fn new() -> Self {
76        #[allow(unused_mut)]
77        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
78        ret
79    }
80    #[deprecated = "Use `set_id()` instead."]
81    pub fn id(&mut self, val: &str) -> &mut Self {
82        self.set_id(val);
83        self
84    }
85    #[deprecated = "Use `set_timestamp()` instead."]
86    pub fn timestamp(&mut self, val: f64) -> &mut Self {
87        self.set_timestamp(val);
88        self
89    }
90    #[cfg(feature = "RtcStatsType")]
91    #[deprecated = "Use `set_type()` instead."]
92    pub fn type_(&mut self, val: RtcStatsType) -> &mut Self {
93        self.set_type(val);
94        self
95    }
96    #[deprecated = "Use `set_contributor_ssrc()` instead."]
97    pub fn contributor_ssrc(&mut self, val: u32) -> &mut Self {
98        self.set_contributor_ssrc(val);
99        self
100    }
101    #[deprecated = "Use `set_inbound_rtp_stream_id()` instead."]
102    pub fn inbound_rtp_stream_id(&mut self, val: &str) -> &mut Self {
103        self.set_inbound_rtp_stream_id(val);
104        self
105    }
106}
107impl Default for RtcrtpContributingSourceStats {
108    fn default() -> Self {
109        Self::new()
110    }
111}