Skip to main content

web_sys/features/
gen_GpuExternalTextureDescriptor.rs

1#![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 = GPUExternalTextureDescriptor)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `GpuExternalTextureDescriptor` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`*"]
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 GpuExternalTextureDescriptor;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `label` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`*"]
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 = "label")]
25    pub fn get_label(this: &GpuExternalTextureDescriptor) -> Option<::alloc::string::String>;
26    #[cfg(web_sys_unstable_apis)]
27    #[doc = "Change the `label` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`*"]
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 = "label")]
34    pub fn set_label(this: &GpuExternalTextureDescriptor, val: &str);
35    #[cfg(web_sys_unstable_apis)]
36    #[cfg(feature = "HtmlVideoElement")]
37    #[doc = "Get the `source` field of this object."]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`, `HtmlVideoElement`*"]
40    #[doc = ""]
41    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
42    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
43    #[wasm_bindgen(method, getter = "source")]
44    pub fn get_source(this: &GpuExternalTextureDescriptor) -> ::js_sys::Object;
45    #[cfg(web_sys_unstable_apis)]
46    #[cfg(feature = "HtmlVideoElement")]
47    #[doc = "Change the `source` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`, `HtmlVideoElement`*"]
50    #[doc = ""]
51    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
53    #[wasm_bindgen(method, setter = "source")]
54    pub fn set_source(this: &GpuExternalTextureDescriptor, val: &HtmlVideoElement);
55    #[cfg(web_sys_unstable_apis)]
56    #[cfg(feature = "VideoFrame")]
57    #[doc = "Change the `source` field of this object."]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`, `VideoFrame`*"]
60    #[doc = ""]
61    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
62    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
63    #[wasm_bindgen(method, setter = "source")]
64    pub fn set_source_video_frame(this: &GpuExternalTextureDescriptor, val: &VideoFrame);
65}
66#[cfg(web_sys_unstable_apis)]
67impl GpuExternalTextureDescriptor {
68    #[cfg(feature = "HtmlVideoElement")]
69    #[doc = "Construct a new `GpuExternalTextureDescriptor`."]
70    #[doc = ""]
71    #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`, `HtmlVideoElement`*"]
72    #[doc = ""]
73    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
74    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
75    pub fn new(source: &HtmlVideoElement) -> Self {
76        #[allow(unused_mut)]
77        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
78        ret.set_source(source);
79        ret
80    }
81    #[cfg(feature = "VideoFrame")]
82    #[doc = "Construct a new `GpuExternalTextureDescriptor`."]
83    #[doc = ""]
84    #[doc = "*This API requires the following crate features to be activated: `GpuExternalTextureDescriptor`, `VideoFrame`*"]
85    #[doc = ""]
86    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
87    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
88    pub fn new_with_video_frame(source: &VideoFrame) -> Self {
89        #[allow(unused_mut)]
90        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
91        ret.set_source_video_frame(source);
92        ret
93    }
94    #[cfg(web_sys_unstable_apis)]
95    #[deprecated = "Use `set_label()` instead."]
96    pub fn label(&mut self, val: &str) -> &mut Self {
97        self.set_label(val);
98        self
99    }
100    #[cfg(web_sys_unstable_apis)]
101    #[cfg(feature = "HtmlVideoElement")]
102    #[deprecated = "Use `set_source()` instead."]
103    pub fn source(&mut self, val: &HtmlVideoElement) -> &mut Self {
104        self.set_source(val);
105        self
106    }
107}