Prompt for paths asynchronously to avoid double borrow

This commit is contained in:
Antonio Scandurra
2021-04-14 16:30:03 +02:00
parent 29d2236ed2
commit cf23b0e4a2
7 changed files with 70 additions and 35 deletions
+5 -1
View File
@@ -40,7 +40,11 @@ pub trait Platform {
executor: Rc<executor::Foreground>,
) -> Box<dyn Window>;
fn key_window_id(&self) -> Option<usize>;
fn prompt_for_paths(&self, options: PathPromptOptions) -> Option<Vec<PathBuf>>;
fn prompt_for_paths(
&self,
options: PathPromptOptions,
done_fn: Box<dyn FnOnce(Option<Vec<std::path::PathBuf>>)>,
);
fn quit(&self);
fn write_to_clipboard(&self, item: ClipboardItem);
fn read_from_clipboard(&self) -> Option<ClipboardItem>;