pub struct FileDialog {
pub filename: Option<String>,
pub location: Option<PathBuf>,
pub filters: Vec<Filter>,
pub title: Option<String>,
}
Expand description
Builds and shows file dialogs.
Fields§
§filename: Option<String>
§location: Option<PathBuf>
§filters: Vec<Filter>
§title: Option<String>
Implementations§
Source§impl FileDialog
impl FileDialog
Sourcepub fn set_filename(self, filename: String) -> Self
pub fn set_filename(self, filename: String) -> Self
Sets the default value of the filename text field in the dialog. For open dialogs of macOS and zenity, this is a no-op because there’s no such text field on the dialog.
Sourcepub fn reset_filename(self) -> Self
pub fn reset_filename(self) -> Self
Resets the default value of the filename field in the dialog.
Sourcepub fn set_location(self, path: PathBuf) -> Self
pub fn set_location(self, path: PathBuf) -> Self
Sets the default location that the dialog shows at open.
Sourcepub fn reset_location(self) -> Self
pub fn reset_location(self) -> Self
Resets the default location that the dialog shows at open. Without a default location set, the dialog will probably use the current working directory as default location.
Sourcepub fn add_filter(self, description: String, extensions: Vec<String>) -> Self
pub fn add_filter(self, description: String, extensions: Vec<String>) -> Self
Adds a file type filter. The filter must contains at least one extension, otherwise this method will panic. For dialogs that open directories, this is a no-op.
Sourcepub fn remove_all_filters(self) -> Self
pub fn remove_all_filters(self) -> Self
Removes all file type filters.
Trait Implementations§
Source§impl Debug for FileDialog
impl Debug for FileDialog
Source§impl Default for FileDialog
impl Default for FileDialog
Source§impl PartialEq for FileDialog
impl PartialEq for FileDialog
impl StructuralPartialEq for FileDialog
Auto 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> ActionTrait for T
impl<T> ActionTrait for T
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