pub struct MessageDialog<'a> { /* private fields */ }Expand description
Builds and shows message dialogs.
Implementations§
Source§impl<'a> MessageDialog<'a>
impl<'a> MessageDialog<'a>
pub fn new() -> Self
Sourcepub fn set_type(self, typ: MessageType) -> Self
pub fn set_type(self, typ: MessageType) -> Self
Set the type of the message. This usually affects the icon shown in the dialog.
Sourcepub fn set_owner<W: HasWindowHandle>(self, window: Option<&W>) -> Self
pub fn set_owner<W: HasWindowHandle>(self, window: Option<&W>) -> Self
Sets the owner of the dialog. On Unix and GNU/Linux, this is a no-op.
Sourcepub unsafe fn set_owner_handle(self, handle: Option<RawWindowHandle>) -> Self
pub unsafe fn set_owner_handle(self, handle: Option<RawWindowHandle>) -> Self
Sets the owner of the dialog by raw handle. On Unix and GNU/Linux, this is a no-op.
§Safety
It’s the caller’s responsibility that ensuring the handle is valid.
Sourcepub fn reset_owner(self) -> Self
pub fn reset_owner(self) -> Self
Resets the owner of the dialog to nothing.
Sourcepub fn show_alert(self) -> Result<()>
pub fn show_alert(self) -> Result<()>
Shows a dialog that alert users with some message.
Sourcepub fn show_confirm(self) -> Result<bool>
pub fn show_confirm(self) -> Result<bool>
Shows a dialog that let users to choose Yes/No.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Send for MessageDialog<'a>
impl<'a> !Sync for MessageDialog<'a>
impl<'a> Freeze for MessageDialog<'a>
impl<'a> RefUnwindSafe for MessageDialog<'a>
impl<'a> Unpin for MessageDialog<'a>
impl<'a> UnsafeUnpin for MessageDialog<'a>
impl<'a> UnwindSafe for MessageDialog<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more