web_sys/features/
gen_ImageDecodeResult.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 = ImageDecodeResult)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `ImageDecodeResult` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `ImageDecodeResult`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type ImageDecodeResult;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `complete` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `ImageDecodeResult`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
24    #[wasm_bindgen(method, getter = "complete")]
25    pub fn get_complete(this: &ImageDecodeResult) -> bool;
26    #[cfg(web_sys_unstable_apis)]
27    #[doc = "Change the `complete` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `ImageDecodeResult`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
33    #[wasm_bindgen(method, setter = "complete")]
34    pub fn set_complete(this: &ImageDecodeResult, val: bool);
35    #[cfg(web_sys_unstable_apis)]
36    #[cfg(feature = "VideoFrame")]
37    #[doc = "Get the `image` field of this object."]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `ImageDecodeResult`, `VideoFrame`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
43    #[wasm_bindgen(method, getter = "image")]
44    pub fn get_image(this: &ImageDecodeResult) -> VideoFrame;
45    #[cfg(web_sys_unstable_apis)]
46    #[cfg(feature = "VideoFrame")]
47    #[doc = "Change the `image` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `ImageDecodeResult`, `VideoFrame`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
53    #[wasm_bindgen(method, setter = "image")]
54    pub fn set_image(this: &ImageDecodeResult, val: &VideoFrame);
55}
56#[cfg(web_sys_unstable_apis)]
57impl ImageDecodeResult {
58    #[cfg(feature = "VideoFrame")]
59    #[doc = "Construct a new `ImageDecodeResult`."]
60    #[doc = ""]
61    #[doc = "*This API requires the following crate features to be activated: `ImageDecodeResult`, `VideoFrame`*"]
62    #[doc = ""]
63    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
64    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
65    pub fn new(complete: bool, image: &VideoFrame) -> Self {
66        #[allow(unused_mut)]
67        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
68        ret.set_complete(complete);
69        ret.set_image(image);
70        ret
71    }
72    #[cfg(web_sys_unstable_apis)]
73    #[deprecated = "Use `set_complete()` instead."]
74    pub fn complete(&mut self, val: bool) -> &mut Self {
75        self.set_complete(val);
76        self
77    }
78    #[cfg(web_sys_unstable_apis)]
79    #[cfg(feature = "VideoFrame")]
80    #[deprecated = "Use `set_image()` instead."]
81    pub fn image(&mut self, val: &VideoFrame) -> &mut Self {
82        self.set_image(val);
83        self
84    }
85}