maxcountryman_web_sys/features/
gen_XrRenderStateInit.rs

1#![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 = XRRenderStateInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `XrRenderStateInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
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 XrRenderStateInit;
16}
17#[cfg(web_sys_unstable_apis)]
18impl XrRenderStateInit {
19    #[doc = "Construct a new `XrRenderStateInit`."]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
22    #[doc = ""]
23    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
24    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
25    pub fn new() -> Self {
26        #[allow(unused_mut)]
27        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
28        ret
29    }
30    #[cfg(web_sys_unstable_apis)]
31    #[cfg(feature = "XrWebGlLayer")]
32    #[doc = "Change the `baseLayer` field of this object."]
33    #[doc = ""]
34    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`, `XrWebGlLayer`*"]
35    #[doc = ""]
36    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
37    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
38    pub fn base_layer(&mut self, val: Option<&XrWebGlLayer>) -> &mut Self {
39        use wasm_bindgen::JsValue;
40        let r = ::js_sys::Reflect::set(
41            self.as_ref(),
42            &JsValue::from("baseLayer"),
43            &JsValue::from(val),
44        );
45        debug_assert!(
46            r.is_ok(),
47            "setting properties should never fail on our dictionary objects"
48        );
49        let _ = r;
50        self
51    }
52    #[cfg(web_sys_unstable_apis)]
53    #[doc = "Change the `depthFar` field of this object."]
54    #[doc = ""]
55    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
56    #[doc = ""]
57    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
58    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
59    pub fn depth_far(&mut self, val: f64) -> &mut Self {
60        use wasm_bindgen::JsValue;
61        let r = ::js_sys::Reflect::set(
62            self.as_ref(),
63            &JsValue::from("depthFar"),
64            &JsValue::from(val),
65        );
66        debug_assert!(
67            r.is_ok(),
68            "setting properties should never fail on our dictionary objects"
69        );
70        let _ = r;
71        self
72    }
73    #[cfg(web_sys_unstable_apis)]
74    #[doc = "Change the `depthNear` field of this object."]
75    #[doc = ""]
76    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
77    #[doc = ""]
78    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
79    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
80    pub fn depth_near(&mut self, val: f64) -> &mut Self {
81        use wasm_bindgen::JsValue;
82        let r = ::js_sys::Reflect::set(
83            self.as_ref(),
84            &JsValue::from("depthNear"),
85            &JsValue::from(val),
86        );
87        debug_assert!(
88            r.is_ok(),
89            "setting properties should never fail on our dictionary objects"
90        );
91        let _ = r;
92        self
93    }
94    #[cfg(web_sys_unstable_apis)]
95    #[doc = "Change the `inlineVerticalFieldOfView` field of this object."]
96    #[doc = ""]
97    #[doc = "*This API requires the following crate features to be activated: `XrRenderStateInit`*"]
98    #[doc = ""]
99    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
100    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
101    pub fn inline_vertical_field_of_view(&mut self, val: f64) -> &mut Self {
102        use wasm_bindgen::JsValue;
103        let r = ::js_sys::Reflect::set(
104            self.as_ref(),
105            &JsValue::from("inlineVerticalFieldOfView"),
106            &JsValue::from(val),
107        );
108        debug_assert!(
109            r.is_ok(),
110            "setting properties should never fail on our dictionary objects"
111        );
112        let _ = r;
113        self
114    }
115}
116#[cfg(web_sys_unstable_apis)]
117impl Default for XrRenderStateInit {
118    fn default() -> Self {
119        Self::new()
120    }
121}