Skip to main content

FileDialogs

Trait FileDialogs 

Source
pub trait FileDialogs {
    // Required methods
    fn open_file(
        &self,
        parent: Option<ViewId>,
        options: OpenOptions,
    ) -> FileDialogFuture<Option<PickedFile>>;
    fn open_files(
        &self,
        parent: Option<ViewId>,
        options: OpenOptions,
    ) -> FileDialogFuture<Vec<PickedFile>>;
    fn open_folder(
        &self,
        parent: Option<ViewId>,
        options: FolderOptions,
    ) -> FileDialogFuture<Option<PickedFolder>>;
    fn save_file(
        &self,
        parent: Option<ViewId>,
        options: SaveOptions,
    ) -> FileDialogFuture<Option<PickedFile>>;
}
Expand description

The system’s file dialogs. parent is the view whose window a dialog belongs to, which the system shows it on, as a sheet where it has them (macOS); without one it stands alone.

Required Methods§

Source

fn open_file( &self, parent: Option<ViewId>, options: OpenOptions, ) -> FileDialogFuture<Option<PickedFile>>

Asks for one file to open; None if the user cancelled.

Source

fn open_files( &self, parent: Option<ViewId>, options: OpenOptions, ) -> FileDialogFuture<Vec<PickedFile>>

Asks for files to open; none if the user cancelled.

Source

fn open_folder( &self, parent: Option<ViewId>, options: FolderOptions, ) -> FileDialogFuture<Option<PickedFolder>>

Asks for a folder; None if the user cancelled.

Source

fn save_file( &self, parent: Option<ViewId>, options: SaveOptions, ) -> FileDialogFuture<Option<PickedFile>>

Asks where to save a file, which the pick may then write; None if the user cancelled.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§