pub struct FileDialog { /* private fields */ }Expand description
Builder for launching file dialogs
Implementations§
Source§impl FileDialog
impl FileDialog
Sourcepub fn new(mode: DialogMode) -> Self
pub fn new(mode: DialogMode) -> Self
Create a new builder with the given mode
Sourcepub fn default_file_name(self, name: impl Into<String>) -> Self
pub fn default_file_name(self, name: impl Into<String>) -> Self
Set default file name (for SaveFile)
Sourcepub fn multi_select(self, yes: bool) -> Self
pub fn multi_select(self, yes: bool) -> Self
Allow multi selection (only for OpenFiles)
Show hidden files in ImGui browser (native follows OS behavior)
Sourcepub fn filter<F: Into<FileFilter>>(self, filter: F) -> Self
pub fn filter<F: Into<FileFilter>>(self, filter: F) -> Self
Add a filter.
Examples
use dear_file_browser::{FileDialog, DialogMode};
let d = FileDialog::new(DialogMode::OpenFile)
.filter(("Images", &["png", "jpg"]))
.filter(("Rust", &["rs"]))
.show_hidden(true);Sourcepub fn filters<I, F>(self, filters: I) -> Self
pub fn filters<I, F>(self, filters: I) -> Self
Add multiple filters.
The list will be appended to any previously-added filters. Extensions are compared case-insensitively and should be provided without dots.
Examples
use dear_file_browser::{FileDialog, DialogMode, FileFilter};
let filters = vec![
FileFilter::from(("Images", &["png", "jpg", "jpeg"]))
];
let d = FileDialog::new(DialogMode::OpenFiles)
.filters(filters)
.multi_select(true);Source§impl FileDialog
impl FileDialog
Sourcepub fn open_blocking(self) -> Result<Selection, FileDialogError>
pub fn open_blocking(self) -> Result<Selection, FileDialogError>
Open a dialog synchronously (blocking).
Sourcepub async fn open_async(self) -> Result<Selection, FileDialogError>
pub async fn open_async(self) -> Result<Selection, FileDialogError>
Open a dialog asynchronously via rfd::AsyncFileDialog.
Trait Implementations§
Source§impl Clone for FileDialog
impl Clone for FileDialog
Source§fn clone(&self) -> FileDialog
fn clone(&self) -> FileDialog
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 moreAuto Trait Implementations§
impl Freeze for FileDialog
impl RefUnwindSafe for FileDialog
impl Send for FileDialog
impl Sync for FileDialog
impl Unpin for FileDialog
impl UnwindSafe for FileDialog
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