pub struct MockFileDialogs(/* private fields */);Expand description
File dialogs that answer what the test gave, and keep each dialog asked for. Until the test gives an answer, every dialog is cancelled. Every clone is the same dialogs.
Implementations§
Source§impl MockFileDialogs
impl MockFileDialogs
pub fn new() -> MockFileDialogs
Sourcepub fn answering_paths(self, paths: Vec<PathBuf>) -> MockFileDialogs
pub fn answering_paths(self, paths: Vec<PathBuf>) -> MockFileDialogs
Answers every dialog with paths: one file or folder the first of them, files all.
Sourcepub fn answering(
self,
picks: impl Fn() -> Vec<PickedFile> + 'static,
) -> MockFileDialogs
pub fn answering( self, picks: impl Fn() -> Vec<PickedFile> + 'static, ) -> MockFileDialogs
Answers every file dialog with what picks makes: one file the first; a folder dialog is
cancelled.
Sourcepub fn answering_folder(
self,
folder: impl Fn() -> PickedFolder + 'static,
) -> MockFileDialogs
pub fn answering_folder( self, folder: impl Fn() -> PickedFolder + 'static, ) -> MockFileDialogs
Answers every folder dialog with what folder makes; a file dialog is cancelled.
Sourcepub fn failing(self, reason: impl Into<String>) -> MockFileDialogs
pub fn failing(self, reason: impl Into<String>) -> MockFileDialogs
Fails every dialog with reason, as a system that did not show it.
Sourcepub fn asked(&self) -> Vec<AskedDialog>
pub fn asked(&self) -> Vec<AskedDialog>
The dialogs asked for, in order.
Trait Implementations§
Source§impl Clone for MockFileDialogs
impl Clone for MockFileDialogs
Source§impl Default for MockFileDialogs
impl Default for MockFileDialogs
Source§impl FileDialogs for MockFileDialogs
impl FileDialogs for MockFileDialogs
Source§fn open_file(
&self,
parent: Option<ViewId>,
options: OpenOptions,
) -> FileDialogFuture<Option<PickedFile>>
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>>
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>>
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>>
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.Auto Trait Implementations§
impl !RefUnwindSafe for MockFileDialogs
impl !Send for MockFileDialogs
impl !Sync for MockFileDialogs
impl !UnwindSafe for MockFileDialogs
impl Forget for MockFileDialogs
impl Freeze for MockFileDialogs
impl Move for MockFileDialogs
impl Unpin for MockFileDialogs
impl UnsafeUnpin for MockFileDialogswhere
*const RcInner<DialogsState> is !null: UnsafeUnpin,
PhantomData<RcInner<DialogsState>>: UnsafeUnpin,
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