web_sys/features/
gen_XrPermissionDescriptor.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 = XRPermissionDescriptor)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `XrPermissionDescriptor` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `XrPermissionDescriptor`*"]
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 XrPermissionDescriptor;
17    #[cfg(web_sys_unstable_apis)]
18    #[cfg(feature = "PermissionName")]
19    #[doc = "Get the `name` field of this object."]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `XrPermissionDescriptor`*"]
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    #[wasm_bindgen(method, getter = "name")]
26    pub fn get_name(this: &XrPermissionDescriptor) -> PermissionName;
27    #[cfg(web_sys_unstable_apis)]
28    #[cfg(feature = "PermissionName")]
29    #[doc = "Change the `name` field of this object."]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `XrPermissionDescriptor`*"]
32    #[doc = ""]
33    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
35    #[wasm_bindgen(method, setter = "name")]
36    pub fn set_name(this: &XrPermissionDescriptor, val: PermissionName);
37    #[cfg(web_sys_unstable_apis)]
38    #[cfg(feature = "XrSessionMode")]
39    #[doc = "Get the `mode` field of this object."]
40    #[doc = ""]
41    #[doc = "*This API requires the following crate features to be activated: `XrPermissionDescriptor`, `XrSessionMode`*"]
42    #[doc = ""]
43    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
44    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
45    #[wasm_bindgen(method, getter = "mode")]
46    pub fn get_mode(this: &XrPermissionDescriptor) -> Option<XrSessionMode>;
47    #[cfg(web_sys_unstable_apis)]
48    #[cfg(feature = "XrSessionMode")]
49    #[doc = "Change the `mode` field of this object."]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `XrPermissionDescriptor`, `XrSessionMode`*"]
52    #[doc = ""]
53    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
54    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
55    #[wasm_bindgen(method, setter = "mode")]
56    pub fn set_mode(this: &XrPermissionDescriptor, val: XrSessionMode);
57    #[cfg(web_sys_unstable_apis)]
58    #[doc = "Get the `optionalFeatures` field of this object."]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `XrPermissionDescriptor`*"]
61    #[doc = ""]
62    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
63    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
64    #[wasm_bindgen(method, getter = "optionalFeatures")]
65    pub fn get_optional_features(this: &XrPermissionDescriptor) -> Option<::js_sys::Array>;
66    #[cfg(web_sys_unstable_apis)]
67    #[doc = "Change the `optionalFeatures` field of this object."]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `XrPermissionDescriptor`*"]
70    #[doc = ""]
71    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
72    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
73    #[wasm_bindgen(method, setter = "optionalFeatures")]
74    pub fn set_optional_features(this: &XrPermissionDescriptor, val: &::wasm_bindgen::JsValue);
75    #[cfg(web_sys_unstable_apis)]
76    #[doc = "Get the `requiredFeatures` field of this object."]
77    #[doc = ""]
78    #[doc = "*This API requires the following crate features to be activated: `XrPermissionDescriptor`*"]
79    #[doc = ""]
80    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
81    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
82    #[wasm_bindgen(method, getter = "requiredFeatures")]
83    pub fn get_required_features(this: &XrPermissionDescriptor) -> Option<::js_sys::Array>;
84    #[cfg(web_sys_unstable_apis)]
85    #[doc = "Change the `requiredFeatures` field of this object."]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `XrPermissionDescriptor`*"]
88    #[doc = ""]
89    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
90    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
91    #[wasm_bindgen(method, setter = "requiredFeatures")]
92    pub fn set_required_features(this: &XrPermissionDescriptor, val: &::wasm_bindgen::JsValue);
93}
94#[cfg(web_sys_unstable_apis)]
95impl XrPermissionDescriptor {
96    #[cfg(feature = "PermissionName")]
97    #[doc = "Construct a new `XrPermissionDescriptor`."]
98    #[doc = ""]
99    #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `XrPermissionDescriptor`*"]
100    #[doc = ""]
101    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
102    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
103    pub fn new(name: PermissionName) -> Self {
104        #[allow(unused_mut)]
105        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
106        ret.set_name(name);
107        ret
108    }
109    #[cfg(web_sys_unstable_apis)]
110    #[cfg(feature = "PermissionName")]
111    #[deprecated = "Use `set_name()` instead."]
112    pub fn name(&mut self, val: PermissionName) -> &mut Self {
113        self.set_name(val);
114        self
115    }
116    #[cfg(web_sys_unstable_apis)]
117    #[cfg(feature = "XrSessionMode")]
118    #[deprecated = "Use `set_mode()` instead."]
119    pub fn mode(&mut self, val: XrSessionMode) -> &mut Self {
120        self.set_mode(val);
121        self
122    }
123    #[cfg(web_sys_unstable_apis)]
124    #[deprecated = "Use `set_optional_features()` instead."]
125    pub fn optional_features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
126        self.set_optional_features(val);
127        self
128    }
129    #[cfg(web_sys_unstable_apis)]
130    #[deprecated = "Use `set_required_features()` instead."]
131    pub fn required_features(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
132        self.set_required_features(val);
133        self
134    }
135}