web_sys/features/
gen_PermissionDescriptor.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = PermissionDescriptor)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `PermissionDescriptor` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `PermissionDescriptor`*"]
12    pub type PermissionDescriptor;
13    #[cfg(feature = "PermissionName")]
14    #[doc = "Get the `name` field of this object."]
15    #[doc = ""]
16    #[doc = "*This API requires the following crate features to be activated: `PermissionDescriptor`, `PermissionName`*"]
17    #[wasm_bindgen(method, getter = "name")]
18    pub fn get_name(this: &PermissionDescriptor) -> PermissionName;
19    #[cfg(feature = "PermissionName")]
20    #[doc = "Change the `name` field of this object."]
21    #[doc = ""]
22    #[doc = "*This API requires the following crate features to be activated: `PermissionDescriptor`, `PermissionName`*"]
23    #[wasm_bindgen(method, setter = "name")]
24    pub fn set_name(this: &PermissionDescriptor, val: PermissionName);
25}
26impl PermissionDescriptor {
27    #[cfg(feature = "PermissionName")]
28    #[doc = "Construct a new `PermissionDescriptor`."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `PermissionDescriptor`, `PermissionName`*"]
31    pub fn new(name: PermissionName) -> Self {
32        #[allow(unused_mut)]
33        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
34        ret.set_name(name);
35        ret
36    }
37    #[cfg(feature = "PermissionName")]
38    #[deprecated = "Use `set_name()` instead."]
39    pub fn name(&mut self, val: PermissionName) -> &mut Self {
40        self.set_name(val);
41        self
42    }
43}