pub struct FolderDialog<'a> {
pub title: &'a str,
pub directory: Option<&'a Path>,
pub owner: Option<&'a dyn HasWindowHandle>,
}Expand description
Folder dialog.
The folder dialog allows the user to select a folder or directory.
Fields§
§title: &'a strThe title of the dialog.
directory: Option<&'a Path>The initial directory to show in the folder dialog.
owner: Option<&'a dyn HasWindowHandle>The owner window of the dialog.
Implementations§
Source§impl<'a> FolderDialog<'a>
impl<'a> FolderDialog<'a>
Sourcepub fn show(&self) -> Option<PathBuf>
pub fn show(&self) -> Option<PathBuf>
Show the dialog.
Examples found in repository?
examples/folder_dialog.rs (line 10)
1fn main() {
2 let current_dir = std::env::current_dir().ok();
3
4 let dialog = rustydialogs::FolderDialog {
5 title: "Select a folder",
6 directory: current_dir.as_deref(),
7 owner: None,
8 };
9
10 match dialog.show() {
11 Some(path) => println!("Selected folder: {}", path.display()),
12 None => println!("Folder selection canceled"),
13 }
14}Trait Implementations§
Source§impl<'a> Clone for FolderDialog<'a>
impl<'a> Clone for FolderDialog<'a>
Source§fn clone(&self) -> FolderDialog<'a>
fn clone(&self) -> FolderDialog<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for FolderDialog<'a>
Auto Trait Implementations§
impl<'a> Freeze for FolderDialog<'a>
impl<'a> !RefUnwindSafe for FolderDialog<'a>
impl<'a> !Send for FolderDialog<'a>
impl<'a> !Sync for FolderDialog<'a>
impl<'a> Unpin for FolderDialog<'a>
impl<'a> UnsafeUnpin for FolderDialog<'a>
impl<'a> !UnwindSafe for FolderDialog<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more