pub trait FileDialogs:
Send
+ Sync
+ 'static {
// Required methods
fn open_file(&self, request: FileDialog) -> Option<PathBuf>;
fn open_files(&self, request: FileDialog) -> Vec<PathBuf>;
fn save_file(&self, request: FileDialog) -> Option<PathBuf>;
fn pick_folder(&self, request: FileDialog) -> Option<PathBuf>;
}Expand description
The OS file-chooser, as the vocabulary crate sees it.
Every method BLOCKS until the user answers, which is why the whole trait is Send + Sync: the caller
runs it on a worker thread and takes the answer back on the UI thread. Nothing here touches the event
loop, so a backend is free to be a portal call, a native panel, or a stub in a test.
Required Methods§
fn open_file(&self, request: FileDialog) -> Option<PathBuf>
fn open_files(&self, request: FileDialog) -> Vec<PathBuf>
fn save_file(&self, request: FileDialog) -> Option<PathBuf>
fn pick_folder(&self, request: FileDialog) -> Option<PathBuf>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".