web_sys/features/
gen_FileSystemPermissionDescriptor.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 = FileSystemPermissionDescriptor)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `FileSystemPermissionDescriptor` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `FileSystemPermissionDescriptor`*"]
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 FileSystemPermissionDescriptor;
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: `FileSystemPermissionDescriptor`, `PermissionName`*"]
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: &FileSystemPermissionDescriptor) -> 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: `FileSystemPermissionDescriptor`, `PermissionName`*"]
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: &FileSystemPermissionDescriptor, val: PermissionName);
37    #[cfg(web_sys_unstable_apis)]
38    #[cfg(feature = "FileSystemHandle")]
39    #[doc = "Get the `handle` field of this object."]
40    #[doc = ""]
41    #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`, `FileSystemPermissionDescriptor`*"]
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 = "handle")]
46    pub fn get_handle(this: &FileSystemPermissionDescriptor) -> FileSystemHandle;
47    #[cfg(web_sys_unstable_apis)]
48    #[cfg(feature = "FileSystemHandle")]
49    #[doc = "Change the `handle` field of this object."]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`, `FileSystemPermissionDescriptor`*"]
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 = "handle")]
56    pub fn set_handle(this: &FileSystemPermissionDescriptor, val: &FileSystemHandle);
57    #[cfg(web_sys_unstable_apis)]
58    #[cfg(feature = "FileSystemPermissionMode")]
59    #[doc = "Get the `mode` field of this object."]
60    #[doc = ""]
61    #[doc = "*This API requires the following crate features to be activated: `FileSystemPermissionDescriptor`, `FileSystemPermissionMode`*"]
62    #[doc = ""]
63    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
64    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
65    #[wasm_bindgen(method, getter = "mode")]
66    pub fn get_mode(this: &FileSystemPermissionDescriptor) -> Option<FileSystemPermissionMode>;
67    #[cfg(web_sys_unstable_apis)]
68    #[cfg(feature = "FileSystemPermissionMode")]
69    #[doc = "Change the `mode` field of this object."]
70    #[doc = ""]
71    #[doc = "*This API requires the following crate features to be activated: `FileSystemPermissionDescriptor`, `FileSystemPermissionMode`*"]
72    #[doc = ""]
73    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
74    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
75    #[wasm_bindgen(method, setter = "mode")]
76    pub fn set_mode(this: &FileSystemPermissionDescriptor, val: FileSystemPermissionMode);
77}
78#[cfg(web_sys_unstable_apis)]
79impl FileSystemPermissionDescriptor {
80    #[cfg(all(feature = "FileSystemHandle", feature = "PermissionName",))]
81    #[doc = "Construct a new `FileSystemPermissionDescriptor`."]
82    #[doc = ""]
83    #[doc = "*This API requires the following crate features to be activated: `FileSystemHandle`, `FileSystemPermissionDescriptor`, `PermissionName`*"]
84    #[doc = ""]
85    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
86    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
87    pub fn new(name: PermissionName, handle: &FileSystemHandle) -> Self {
88        #[allow(unused_mut)]
89        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
90        ret.set_name(name);
91        ret.set_handle(handle);
92        ret
93    }
94    #[cfg(web_sys_unstable_apis)]
95    #[cfg(feature = "PermissionName")]
96    #[deprecated = "Use `set_name()` instead."]
97    pub fn name(&mut self, val: PermissionName) -> &mut Self {
98        self.set_name(val);
99        self
100    }
101    #[cfg(web_sys_unstable_apis)]
102    #[cfg(feature = "FileSystemHandle")]
103    #[deprecated = "Use `set_handle()` instead."]
104    pub fn handle(&mut self, val: &FileSystemHandle) -> &mut Self {
105        self.set_handle(val);
106        self
107    }
108    #[cfg(web_sys_unstable_apis)]
109    #[cfg(feature = "FileSystemPermissionMode")]
110    #[deprecated = "Use `set_mode()` instead."]
111    pub fn mode(&mut self, val: FileSystemPermissionMode) -> &mut Self {
112        self.set_mode(val);
113        self
114    }
115}