web_sys/features/
gen_RtcRtpContributingSource.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 = RTCRtpContributingSource)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `RtcRtpContributingSource` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"]
12    pub type RtcRtpContributingSource;
13    #[doc = "Get the `audioLevel` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"]
16    #[wasm_bindgen(method, getter = "audioLevel")]
17    pub fn get_audio_level(this: &RtcRtpContributingSource) -> Option<f64>;
18    #[doc = "Change the `audioLevel` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"]
21    #[wasm_bindgen(method, setter = "audioLevel")]
22    pub fn set_audio_level(this: &RtcRtpContributingSource, val: f64);
23    #[doc = "Get the `source` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"]
26    #[wasm_bindgen(method, getter = "source")]
27    pub fn get_source(this: &RtcRtpContributingSource) -> u32;
28    #[doc = "Change the `source` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"]
31    #[wasm_bindgen(method, setter = "source")]
32    pub fn set_source(this: &RtcRtpContributingSource, val: u32);
33    #[doc = "Get the `timestamp` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"]
36    #[wasm_bindgen(method, getter = "timestamp")]
37    pub fn get_timestamp(this: &RtcRtpContributingSource) -> f64;
38    #[doc = "Change the `timestamp` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"]
41    #[wasm_bindgen(method, setter = "timestamp")]
42    pub fn set_timestamp(this: &RtcRtpContributingSource, val: f64);
43}
44impl RtcRtpContributingSource {
45    #[doc = "Construct a new `RtcRtpContributingSource`."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"]
48    pub fn new(source: u32, timestamp: f64) -> Self {
49        #[allow(unused_mut)]
50        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
51        ret.set_source(source);
52        ret.set_timestamp(timestamp);
53        ret
54    }
55    #[deprecated = "Use `set_audio_level()` instead."]
56    pub fn audio_level(&mut self, val: f64) -> &mut Self {
57        self.set_audio_level(val);
58        self
59    }
60    #[deprecated = "Use `set_source()` instead."]
61    pub fn source(&mut self, val: u32) -> &mut Self {
62        self.set_source(val);
63        self
64    }
65    #[deprecated = "Use `set_timestamp()` instead."]
66    pub fn timestamp(&mut self, val: f64) -> &mut Self {
67        self.set_timestamp(val);
68        self
69    }
70}