maxcountryman_web_sys/features/
gen_GpuImageCopyTexture.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 = GPUImageCopyTexture)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `GpuImageCopyTexture` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"]
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 GpuImageCopyTexture;
16}
17#[cfg(web_sys_unstable_apis)]
18impl GpuImageCopyTexture {
19 #[cfg(feature = "GpuTexture")]
20 #[doc = "Construct a new `GpuImageCopyTexture`."]
21 #[doc = ""]
22 #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTexture`*"]
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(texture: &GpuTexture) -> Self {
27 #[allow(unused_mut)]
28 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
29 ret.texture(texture);
30 ret
31 }
32 #[cfg(web_sys_unstable_apis)]
33 #[cfg(feature = "GpuTextureAspect")]
34 #[doc = "Change the `aspect` field of this object."]
35 #[doc = ""]
36 #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTextureAspect`*"]
37 #[doc = ""]
38 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
39 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
40 pub fn aspect(&mut self, val: GpuTextureAspect) -> &mut Self {
41 use wasm_bindgen::JsValue;
42 let r =
43 ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("aspect"), &JsValue::from(val));
44 debug_assert!(
45 r.is_ok(),
46 "setting properties should never fail on our dictionary objects"
47 );
48 let _ = r;
49 self
50 }
51 #[cfg(web_sys_unstable_apis)]
52 #[doc = "Change the `mipLevel` field of this object."]
53 #[doc = ""]
54 #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"]
55 #[doc = ""]
56 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
57 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
58 pub fn mip_level(&mut self, val: u32) -> &mut Self {
59 use wasm_bindgen::JsValue;
60 let r = ::js_sys::Reflect::set(
61 self.as_ref(),
62 &JsValue::from("mipLevel"),
63 &JsValue::from(val),
64 );
65 debug_assert!(
66 r.is_ok(),
67 "setting properties should never fail on our dictionary objects"
68 );
69 let _ = r;
70 self
71 }
72 #[cfg(web_sys_unstable_apis)]
73 #[doc = "Change the `origin` field of this object."]
74 #[doc = ""]
75 #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`*"]
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 origin(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
80 use wasm_bindgen::JsValue;
81 let r =
82 ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("origin"), &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 #[cfg(web_sys_unstable_apis)]
91 #[cfg(feature = "GpuTexture")]
92 #[doc = "Change the `texture` field of this object."]
93 #[doc = ""]
94 #[doc = "*This API requires the following crate features to be activated: `GpuImageCopyTexture`, `GpuTexture`*"]
95 #[doc = ""]
96 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
97 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
98 pub fn texture(&mut self, val: &GpuTexture) -> &mut Self {
99 use wasm_bindgen::JsValue;
100 let r = ::js_sys::Reflect::set(
101 self.as_ref(),
102 &JsValue::from("texture"),
103 &JsValue::from(val),
104 );
105 debug_assert!(
106 r.is_ok(),
107 "setting properties should never fail on our dictionary objects"
108 );
109 let _ = r;
110 self
111 }
112}