Struct tauri_plugin_dialog::MessageDialogBuilder

source ·
pub struct MessageDialogBuilder<R: Runtime> { /* private fields */ }
Expand description

A builder for message dialogs.

Implementations§

source§

impl<R: Runtime> MessageDialogBuilder<R>

source

pub fn new( dialog: Dialog<R>, title: impl Into<String>, message: impl Into<String> ) -> Self

Creates a new message dialog builder.

source

pub fn title(self, title: impl Into<String>) -> Self

Sets the dialog title.

source

pub fn parent<W: HasWindowHandle>(self, parent: &W) -> Self

Set parent windows explicitly (optional)

§Platform-specific
  • Linux: Unsupported.
source

pub fn ok_button_label(self, label: impl Into<String>) -> Self

Sets the label for the OK button.

source

pub fn cancel_button_label(self, label: impl Into<String>) -> Self

Sets the label for the Cancel button.

source

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.

source

pub fn show<F: FnOnce(bool) + Send + 'static>(self, f: F)

Shows a message dialog

source

pub fn blocking_show(self) -> bool

Shows a message dialog. This is a blocking operation, and should NOT be used when running on the main thread context.

Trait Implementations§

source§

impl<R: Runtime> From<MessageDialogBuilder<R>> for AsyncMessageDialog

source§

fn from(d: MessageDialogBuilder<R>) -> Self

Converts to this type from the input type.
source§

impl<R: Runtime> Send for MessageDialogBuilder<R>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.