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