pub struct MessageDialogBuilder(_);
Available on crate feature
dialog
only.Expand description
A builder for message dialogs.
Implementations
sourceimpl MessageDialogBuilder
impl MessageDialogBuilder
sourcepub fn new(title: impl AsRef<str>, message: impl AsRef<str>) -> Self
pub fn new(title: impl AsRef<str>, message: impl AsRef<str>) -> Self
Creates a new message dialog builder.
sourcepub fn parent<W: HasRawWindowHandle>(self, parent: &W) -> Self
pub fn parent<W: HasRawWindowHandle>(self, parent: &W) -> Self
Set the set of button that will be displayed on the dialog.
sourcepub fn kind(self, kind: MessageDialogKind) -> Self
pub fn kind(self, kind: MessageDialogKind) -> Self
Set type of a dialog.
Depending on the system it can result in type specific icon to show up, the will inform user it message is a error, warning or just information.
sourceimpl MessageDialogBuilder
impl MessageDialogBuilder
sourcepub fn show<F: FnOnce(bool) + Send + 'static>(self, f: F)
pub fn show<F: FnOnce(bool) + Send + 'static>(self, f: F)
Shows a message dialog:
- In
Ok
dialog, it will call the closure withtrue
whenOK
was pressed - In
OkCancel
dialog, it will call the closure withtrue
whenOK
was pressed - In
YesNo
dialog, it will call the closure withtrue
whenYes
was pressed
Auto Trait Implementations
impl RefUnwindSafe for MessageDialogBuilder
impl Send for MessageDialogBuilder
impl !Sync for MessageDialogBuilder
impl Unpin for MessageDialogBuilder
impl UnwindSafe for MessageDialogBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more