ferroui_base/platform/storage/
folder_picker_open_options.rs1use super::PickerOptions;
2use std::ops::{Deref, DerefMut};
3
4#[derive(Clone, Default)]
8pub struct FolderPickerOpenOptions {
9 base: PickerOptions,
10 allow_multiple: bool,
11}
12
13impl Deref for FolderPickerOpenOptions {
14 type Target = PickerOptions;
15
16 fn deref(&self) -> &PickerOptions {
17 &self.base
18 }
19}
20
21impl DerefMut for FolderPickerOpenOptions {
22 fn deref_mut(&mut self) -> &mut PickerOptions {
23 &mut self.base
24 }
25}
26
27impl From<PickerOptions> for FolderPickerOpenOptions {
28 fn from(base: PickerOptions) -> Self {
29 Self { base, ..Self::default() }
30 }
31}
32
33impl FolderPickerOpenOptions {
34 pub fn new() -> Self {
36 Self::default()
37 }
38
39 pub fn allow_multiple(&self) -> bool {
42 self.allow_multiple
43 }
44
45 pub fn set_allow_multiple(&mut self, value: bool) {
46 self.allow_multiple = value;
47 }
48
49 pub fn with_allow_multiple(mut self, value: bool) -> Self {
52 self.allow_multiple = value;
53 self
54 }
55}