1 #![allow(unused_imports)] 2 use super::*; 3 use wasm_bindgen::prelude::*; 4 #[cfg(web_sys_unstable_apis)] 5 #[wasm_bindgen] 6 extern "C" { 7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = GPUColorTargetState)] 8 #[derive(Debug, Clone, PartialEq, Eq)] 9 #[doc = "The `GpuColorTargetState` dictionary."] 10 #[doc = ""] 11 #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`*"] 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 GpuColorTargetState; 16 } 17 #[cfg(web_sys_unstable_apis)] 18 impl GpuColorTargetState { 19 #[cfg(feature = "GpuTextureFormat")] 20 #[doc = "Construct a new `GpuColorTargetState`."] 21 #[doc = ""] 22 #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuTextureFormat`*"] 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)*"] new(format: GpuTextureFormat) -> Self26 pub fn new(format: GpuTextureFormat) -> Self { 27 #[allow(unused_mut)] 28 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); 29 ret.format(format); 30 ret 31 } 32 #[cfg(web_sys_unstable_apis)] 33 #[cfg(feature = "GpuBlendState")] 34 #[doc = "Change the `blend` field of this object."] 35 #[doc = ""] 36 #[doc = "*This API requires the following crate features to be activated: `GpuBlendState`, `GpuColorTargetState`*"] 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)*"] blend(&mut self, val: &GpuBlendState) -> &mut Self40 pub fn blend(&mut self, val: &GpuBlendState) -> &mut Self { 41 use wasm_bindgen::JsValue; 42 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("blend"), &JsValue::from(val)); 43 debug_assert!( 44 r.is_ok(), 45 "setting properties should never fail on our dictionary objects" 46 ); 47 let _ = r; 48 self 49 } 50 #[cfg(web_sys_unstable_apis)] 51 #[cfg(feature = "GpuTextureFormat")] 52 #[doc = "Change the `format` field of this object."] 53 #[doc = ""] 54 #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`, `GpuTextureFormat`*"] 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)*"] format(&mut self, val: GpuTextureFormat) -> &mut Self58 pub fn format(&mut self, val: GpuTextureFormat) -> &mut Self { 59 use wasm_bindgen::JsValue; 60 let r = 61 ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("format"), &JsValue::from(val)); 62 debug_assert!( 63 r.is_ok(), 64 "setting properties should never fail on our dictionary objects" 65 ); 66 let _ = r; 67 self 68 } 69 #[cfg(web_sys_unstable_apis)] 70 #[doc = "Change the `writeMask` field of this object."] 71 #[doc = ""] 72 #[doc = "*This API requires the following crate features to be activated: `GpuColorTargetState`*"] 73 #[doc = ""] 74 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] 75 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] write_mask(&mut self, val: u32) -> &mut Self76 pub fn write_mask(&mut self, val: u32) -> &mut Self { 77 use wasm_bindgen::JsValue; 78 let r = ::js_sys::Reflect::set( 79 self.as_ref(), 80 &JsValue::from("writeMask"), 81 &JsValue::from(val), 82 ); 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 } 91