pub struct Dialogs<T> {
shower: Rc<dyn ShowDialog>,
waker: Arc<dyn Waker>,
asked: RefCell<Vec<(FileDialog, T)>>,
answers: Rc<RefCell<VecDeque<(T, Picked)>>>,
}Expand description
The dialogs an app has asked for, and the answers that have come back. T says where
each answer goes, in whatever terms the app uses.
Fields§
§shower: Rc<dyn ShowDialog>§waker: Arc<dyn Waker>§asked: RefCell<Vec<(FileDialog, T)>>§answers: Rc<RefCell<VecDeque<(T, Picked)>>>Implementations§
Source§impl<T: 'static> Dialogs<T>
impl<T: 'static> Dialogs<T>
Sourcepub fn new(shower: Rc<dyn ShowDialog>, waker: Arc<dyn Waker>) -> Self
pub fn new(shower: Rc<dyn ShowDialog>, waker: Arc<dyn Waker>) -> Self
waker asks the UI thread to call Dialogs::show_asked and then, inside an event,
Dialogs::receive.
Sourcepub fn ask(&self, dialog: FileDialog, target: T)
pub fn ask(&self, dialog: FileDialog, target: T)
Asks for dialog, to be shown once the current event has finished.
Sourcepub fn show_asked(&self)
pub fn show_asked(&self)
Shows every dialog asked for since the last call. Call it from the waker’s handler outside any event: a platform may run a modal loop here, which handles other events.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for Dialogs<T>
impl<T> !RefUnwindSafe for Dialogs<T>
impl<T> !Send for Dialogs<T>
impl<T> !Sync for Dialogs<T>
impl<T> !UnwindSafe for Dialogs<T>
impl<T> Unpin for Dialogs<T>where
T: Unpin,
impl<T> UnsafeUnpin for Dialogs<T>
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