web_sys/features/
gen_XrSessionSupportedPermissionDescriptor.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 = XRSessionSupportedPermissionDescriptor)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `XrSessionSupportedPermissionDescriptor` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `XrSessionSupportedPermissionDescriptor`*"]
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 XrSessionSupportedPermissionDescriptor;
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`, `XrSessionSupportedPermissionDescriptor`*"]
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: &XrSessionSupportedPermissionDescriptor) -> 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`, `XrSessionSupportedPermissionDescriptor`*"]
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: &XrSessionSupportedPermissionDescriptor, 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: `XrSessionMode`, `XrSessionSupportedPermissionDescriptor`*"]
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: &XrSessionSupportedPermissionDescriptor) -> 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: `XrSessionMode`, `XrSessionSupportedPermissionDescriptor`*"]
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: &XrSessionSupportedPermissionDescriptor, val: XrSessionMode);
57}
58#[cfg(web_sys_unstable_apis)]
59impl XrSessionSupportedPermissionDescriptor {
60    #[cfg(feature = "PermissionName")]
61    #[doc = "Construct a new `XrSessionSupportedPermissionDescriptor`."]
62    #[doc = ""]
63    #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `XrSessionSupportedPermissionDescriptor`*"]
64    #[doc = ""]
65    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
66    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
67    pub fn new(name: PermissionName) -> Self {
68        #[allow(unused_mut)]
69        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
70        ret.set_name(name);
71        ret
72    }
73    #[cfg(web_sys_unstable_apis)]
74    #[cfg(feature = "PermissionName")]
75    #[deprecated = "Use `set_name()` instead."]
76    pub fn name(&mut self, val: PermissionName) -> &mut Self {
77        self.set_name(val);
78        self
79    }
80    #[cfg(web_sys_unstable_apis)]
81    #[cfg(feature = "XrSessionMode")]
82    #[deprecated = "Use `set_mode()` instead."]
83    pub fn mode(&mut self, val: XrSessionMode) -> &mut Self {
84        self.set_mode(val);
85        self
86    }
87}