web_sys/features/
gen_EncodedVideoChunkInit.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = EncodedVideoChunkInit)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `EncodedVideoChunkInit` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"]
13 #[doc = ""]
14 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
16 pub type EncodedVideoChunkInit;
17 #[cfg(web_sys_unstable_apis)]
18 #[doc = "Get the `data` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"]
21 #[doc = ""]
22 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
24 #[wasm_bindgen(method, getter = "data")]
25 pub fn get_data(this: &EncodedVideoChunkInit) -> ::js_sys::Object;
26 #[cfg(web_sys_unstable_apis)]
27 #[doc = "Change the `data` field of this object."]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"]
30 #[doc = ""]
31 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
32 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
33 #[wasm_bindgen(method, setter = "data")]
34 pub fn set_data(this: &EncodedVideoChunkInit, val: &::js_sys::Object);
35 #[cfg(web_sys_unstable_apis)]
36 #[doc = "Change the `data` field of this object."]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"]
39 #[doc = ""]
40 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
41 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
42 #[wasm_bindgen(method, setter = "data")]
43 pub fn set_data_u8_slice(this: &EncodedVideoChunkInit, val: &mut [u8]);
44 #[cfg(web_sys_unstable_apis)]
45 #[doc = "Change the `data` field of this object."]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"]
48 #[doc = ""]
49 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
50 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
51 #[wasm_bindgen(method, setter = "data")]
52 pub fn set_data_u8_array(this: &EncodedVideoChunkInit, val: &::js_sys::Uint8Array);
53 #[cfg(web_sys_unstable_apis)]
54 #[doc = "Get the `duration` field of this object."]
55 #[doc = ""]
56 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"]
57 #[doc = ""]
58 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
59 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
60 #[wasm_bindgen(method, getter = "duration")]
61 pub fn get_duration(this: &EncodedVideoChunkInit) -> Option<f64>;
62 #[cfg(web_sys_unstable_apis)]
63 #[doc = "Change the `duration` field of this object."]
64 #[doc = ""]
65 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"]
66 #[doc = ""]
67 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
68 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
69 #[wasm_bindgen(method, setter = "duration")]
70 pub fn set_duration(this: &EncodedVideoChunkInit, val: u32);
71 #[cfg(web_sys_unstable_apis)]
72 #[doc = "Change the `duration` field of this object."]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"]
75 #[doc = ""]
76 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
77 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
78 #[wasm_bindgen(method, setter = "duration")]
79 pub fn set_duration_f64(this: &EncodedVideoChunkInit, val: f64);
80 #[cfg(web_sys_unstable_apis)]
81 #[doc = "Get the `timestamp` field of this object."]
82 #[doc = ""]
83 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"]
84 #[doc = ""]
85 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
86 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
87 #[wasm_bindgen(method, getter = "timestamp")]
88 pub fn get_timestamp(this: &EncodedVideoChunkInit) -> f64;
89 #[cfg(web_sys_unstable_apis)]
90 #[doc = "Change the `timestamp` field of this object."]
91 #[doc = ""]
92 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"]
93 #[doc = ""]
94 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
95 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
96 #[wasm_bindgen(method, setter = "timestamp")]
97 pub fn set_timestamp(this: &EncodedVideoChunkInit, val: i32);
98 #[cfg(web_sys_unstable_apis)]
99 #[doc = "Change the `timestamp` field of this object."]
100 #[doc = ""]
101 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"]
102 #[doc = ""]
103 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
104 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
105 #[wasm_bindgen(method, setter = "timestamp")]
106 pub fn set_timestamp_f64(this: &EncodedVideoChunkInit, val: f64);
107 #[cfg(web_sys_unstable_apis)]
108 #[doc = "Get the `transfer` field of this object."]
109 #[doc = ""]
110 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"]
111 #[doc = ""]
112 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
113 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
114 #[wasm_bindgen(method, getter = "transfer")]
115 pub fn get_transfer(
116 this: &EncodedVideoChunkInit,
117 ) -> Option<::js_sys::Array<::js_sys::ArrayBuffer>>;
118 #[cfg(web_sys_unstable_apis)]
119 #[doc = "Change the `transfer` field of this object."]
120 #[doc = ""]
121 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`*"]
122 #[doc = ""]
123 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
124 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
125 #[wasm_bindgen(method, setter = "transfer")]
126 pub fn set_transfer(this: &EncodedVideoChunkInit, val: &[::js_sys::ArrayBuffer]);
127 #[cfg(web_sys_unstable_apis)]
128 #[cfg(feature = "EncodedVideoChunkType")]
129 #[doc = "Get the `type` field of this object."]
130 #[doc = ""]
131 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`, `EncodedVideoChunkType`*"]
132 #[doc = ""]
133 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
134 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
135 #[wasm_bindgen(method, getter = "type")]
136 pub fn get_type(this: &EncodedVideoChunkInit) -> EncodedVideoChunkType;
137 #[cfg(web_sys_unstable_apis)]
138 #[cfg(feature = "EncodedVideoChunkType")]
139 #[doc = "Change the `type` field of this object."]
140 #[doc = ""]
141 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`, `EncodedVideoChunkType`*"]
142 #[doc = ""]
143 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
144 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
145 #[wasm_bindgen(method, setter = "type")]
146 pub fn set_type(this: &EncodedVideoChunkInit, val: EncodedVideoChunkType);
147}
148#[cfg(web_sys_unstable_apis)]
149impl EncodedVideoChunkInit {
150 #[cfg(feature = "EncodedVideoChunkType")]
151 #[doc = "Construct a new `EncodedVideoChunkInit`."]
152 #[doc = ""]
153 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`, `EncodedVideoChunkType`*"]
154 #[doc = ""]
155 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
156 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
157 pub fn new(data: &::js_sys::Object, timestamp: i32, type_: EncodedVideoChunkType) -> Self {
158 #[allow(unused_mut)]
159 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
160 ret.set_data(data);
161 ret.set_timestamp(timestamp);
162 ret.set_type(type_);
163 ret
164 }
165 #[cfg(feature = "EncodedVideoChunkType")]
166 #[doc = "Construct a new `EncodedVideoChunkInit`."]
167 #[doc = ""]
168 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`, `EncodedVideoChunkType`*"]
169 #[doc = ""]
170 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
171 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
172 pub fn new_with_u8_slice(
173 data: &mut [u8],
174 timestamp: i32,
175 type_: EncodedVideoChunkType,
176 ) -> Self {
177 #[allow(unused_mut)]
178 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
179 ret.set_data_u8_slice(data);
180 ret.set_timestamp(timestamp);
181 ret.set_type(type_);
182 ret
183 }
184 #[cfg(feature = "EncodedVideoChunkType")]
185 #[doc = "Construct a new `EncodedVideoChunkInit`."]
186 #[doc = ""]
187 #[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunkInit`, `EncodedVideoChunkType`*"]
188 #[doc = ""]
189 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
190 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
191 pub fn new_with_u8_array(
192 data: &::js_sys::Uint8Array,
193 timestamp: i32,
194 type_: EncodedVideoChunkType,
195 ) -> Self {
196 #[allow(unused_mut)]
197 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
198 ret.set_data_u8_array(data);
199 ret.set_timestamp(timestamp);
200 ret.set_type(type_);
201 ret
202 }
203 #[cfg(web_sys_unstable_apis)]
204 #[deprecated = "Use `set_data()` instead."]
205 pub fn data(&mut self, val: &::js_sys::Object) -> &mut Self {
206 self.set_data(val);
207 self
208 }
209 #[cfg(web_sys_unstable_apis)]
210 #[deprecated = "Use `set_duration()` instead."]
211 pub fn duration(&mut self, val: u32) -> &mut Self {
212 self.set_duration(val);
213 self
214 }
215 #[cfg(web_sys_unstable_apis)]
216 #[deprecated = "Use `set_timestamp()` instead."]
217 pub fn timestamp(&mut self, val: i32) -> &mut Self {
218 self.set_timestamp(val);
219 self
220 }
221 #[cfg(web_sys_unstable_apis)]
222 #[deprecated = "Use `set_transfer()` instead."]
223 pub fn transfer(&mut self, val: &[::js_sys::ArrayBuffer]) -> &mut Self {
224 self.set_transfer(val);
225 self
226 }
227 #[cfg(web_sys_unstable_apis)]
228 #[cfg(feature = "EncodedVideoChunkType")]
229 #[deprecated = "Use `set_type()` instead."]
230 pub fn type_(&mut self, val: EncodedVideoChunkType) -> &mut Self {
231 self.set_type(val);
232 self
233 }
234}