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