Skip to main content

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(
9        extends = "::js_sys::Object",
10        js_name = "XRSessionSupportedPermissionDescriptor"
11    )]
12    #[derive(Debug, Clone, PartialEq, Eq)]
13    #[doc = "The `XrSessionSupportedPermissionDescriptor` dictionary."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `XrSessionSupportedPermissionDescriptor`*"]
16    #[doc = ""]
17    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
18    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
19    pub type XrSessionSupportedPermissionDescriptor;
20    #[cfg(web_sys_unstable_apis)]
21    #[cfg(feature = "PermissionName")]
22    #[doc = "Get the `name` field of this object."]
23    #[doc = ""]
24    #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `XrSessionSupportedPermissionDescriptor`*"]
25    #[doc = ""]
26    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
27    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
28    #[wasm_bindgen(method, getter = "name")]
29    pub fn get_name(this: &XrSessionSupportedPermissionDescriptor) -> PermissionName;
30    #[cfg(web_sys_unstable_apis)]
31    #[cfg(feature = "PermissionName")]
32    #[doc = "Change the `name` field of this object."]
33    #[doc = ""]
34    #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `XrSessionSupportedPermissionDescriptor`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
38    #[wasm_bindgen(method, setter = "name")]
39    pub fn set_name(this: &XrSessionSupportedPermissionDescriptor, val: PermissionName);
40    #[cfg(web_sys_unstable_apis)]
41    #[cfg(feature = "XrSessionMode")]
42    #[doc = "Get the `mode` field of this object."]
43    #[doc = ""]
44    #[doc = "*This API requires the following crate features to be activated: `XrSessionMode`, `XrSessionSupportedPermissionDescriptor`*"]
45    #[doc = ""]
46    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
47    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
48    #[wasm_bindgen(method, getter = "mode")]
49    pub fn get_mode(this: &XrSessionSupportedPermissionDescriptor) -> Option<XrSessionMode>;
50    #[cfg(web_sys_unstable_apis)]
51    #[cfg(feature = "XrSessionMode")]
52    #[doc = "Change the `mode` field of this object."]
53    #[doc = ""]
54    #[doc = "*This API requires the following crate features to be activated: `XrSessionMode`, `XrSessionSupportedPermissionDescriptor`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
58    #[wasm_bindgen(method, setter = "mode")]
59    pub fn set_mode(this: &XrSessionSupportedPermissionDescriptor, val: XrSessionMode);
60}
61#[cfg(web_sys_unstable_apis)]
62impl XrSessionSupportedPermissionDescriptor {
63    #[cfg(feature = "PermissionName")]
64    #[doc = "Construct a new `XrSessionSupportedPermissionDescriptor`."]
65    #[doc = ""]
66    #[doc = "*This API requires the following crate features to be activated: `PermissionName`, `XrSessionSupportedPermissionDescriptor`*"]
67    #[doc = ""]
68    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
69    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
70    pub fn new(name: PermissionName) -> Self {
71        #[allow(unused_mut)]
72        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
73        ret.set_name(name);
74        ret
75    }
76    #[cfg(web_sys_unstable_apis)]
77    #[cfg(feature = "PermissionName")]
78    #[deprecated = "Use `set_name()` instead."]
79    pub fn name(&mut self, val: PermissionName) -> &mut Self {
80        self.set_name(val);
81        self
82    }
83    #[cfg(web_sys_unstable_apis)]
84    #[cfg(feature = "XrSessionMode")]
85    #[deprecated = "Use `set_mode()` instead."]
86    pub fn mode(&mut self, val: XrSessionMode) -> &mut Self {
87        self.set_mode(val);
88        self
89    }
90}