maxcountryman_web_sys/features/
gen_GpuExternalTextureDescriptor.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[cfg(web_sys_unstable_apis)]
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUExternalTextureDescriptor)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `GpuExternalTextureDescriptor` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`*"]
12 #[doc = ""]
13 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
14 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
15 pub type GpuExternalTextureDescriptor;
16}
17#[cfg(web_sys_unstable_apis)]
18impl GpuExternalTextureDescriptor {
19 #[cfg(feature = "HtmlVideoElement")]
20 #[doc = "Construct a new `GpuExternalTextureDescriptor`."]
21 #[doc = ""]
22 #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`, `HtmlVideoElement`*"]
23 #[doc = ""]
24 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
25 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
26 pub fn new(source: &HtmlVideoElement) -> Self {
27 #[allow(unused_mut)]
28 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
29 ret.source(source);
30 ret
31 }
32 #[cfg(web_sys_unstable_apis)]
33 #[doc = "Change the `label` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`*"]
36 #[doc = ""]
37 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
38 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
39 pub fn label(&mut self, val: &str) -> &mut Self {
40 use wasm_bindgen::JsValue;
41 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("label"), &JsValue::from(val));
42 debug_assert!(
43 r.is_ok(),
44 "setting properties should never fail on our dictionary objects"
45 );
46 let _ = r;
47 self
48 }
49 #[cfg(web_sys_unstable_apis)]
50 #[cfg(feature = "GpuPredefinedColorSpace")]
51 #[doc = "Change the `colorSpace` field of this object."]
52 #[doc = ""]
53 #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`, `GpuPredefinedColorSpace`*"]
54 #[doc = ""]
55 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
56 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
57 pub fn color_space(&mut self, val: GpuPredefinedColorSpace) -> &mut Self {
58 use wasm_bindgen::JsValue;
59 let r = ::js_sys::Reflect::set(
60 self.as_ref(),
61 &JsValue::from("colorSpace"),
62 &JsValue::from(val),
63 );
64 debug_assert!(
65 r.is_ok(),
66 "setting properties should never fail on our dictionary objects"
67 );
68 let _ = r;
69 self
70 }
71 #[cfg(web_sys_unstable_apis)]
72 #[cfg(feature = "HtmlVideoElement")]
73 #[doc = "Change the `source` field of this object."]
74 #[doc = ""]
75 #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`, `HtmlVideoElement`*"]
76 #[doc = ""]
77 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
78 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
79 pub fn source(&mut self, val: &HtmlVideoElement) -> &mut Self {
80 use wasm_bindgen::JsValue;
81 let r =
82 ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val));
83 debug_assert!(
84 r.is_ok(),
85 "setting properties should never fail on our dictionary objects"
86 );
87 let _ = r;
88 self
89 }
90}