Struct tauri_sys::dialog::MessageDialogBuilder
source · pub struct MessageDialogBuilder<'a> { /* private fields */ }
Expand description
A builder for message dialogs.
Implementations§
source§impl<'a> MessageDialogBuilder<'a>
impl<'a> MessageDialogBuilder<'a>
pub fn new() -> Self
sourcepub fn set_title(&mut self, title: &'a str) -> &mut Self
pub fn set_title(&mut self, title: &'a str) -> &mut Self
Set the title of the dialog.
§Example
use tauri_sys::dialog::MessageDialogBuilder;
let _builder = MessageDialogBuilder::new().set_title("Test Title");
sourcepub fn set_kind(&mut self, kind: MessageDialogKind) -> &mut Self
pub fn set_kind(&mut self, kind: MessageDialogKind) -> &mut Self
Set the type of the dialog.
§Example
use tauri_sys::dialog::{MessageDialogBuilder,MessageDialogKind};
let _builder = MessageDialogBuilder::new().set_kind(MessageDialogKind::Error);
sourcepub async fn message(&self, message: &str) -> Result<(), Error>
pub async fn message(&self, message: &str) -> Result<(), Error>
Shows a message dialog with an Ok
button.
§Example
use tauri_sys::dialog::MessageDialogBuilder;
let file = MessageDialogBuilder::new().message("Tauri is awesome").await?;
Requires allowlist > dialog > message
to be enabled.
sourcepub async fn ask(&self, message: &str) -> Result<bool, Error>
pub async fn ask(&self, message: &str) -> Result<bool, Error>
Shows a question dialog with Yes
and No
buttons.
§Example
use tauri_sys::dialog::MessageDialogBuilder;
let confirmation = MessageDialogBuilder::new().ask("Are you sure?").await?;
Requires allowlist > dialog > ask
to be enabled.
sourcepub async fn confirm(&self, message: &str) -> Result<bool, Error>
pub async fn confirm(&self, message: &str) -> Result<bool, Error>
Shows a question dialog with Ok
and Cancel
buttons.
§Example
use tauri_sys::dialog::MessageDialogBuilder;
let confirmation = MessageDialogBuilder::new().confirm("Are you sure?").await?;
Requires allowlist > dialog > confirm
to be enabled.
Trait Implementations§
source§impl<'a> Clone for MessageDialogBuilder<'a>
impl<'a> Clone for MessageDialogBuilder<'a>
source§fn clone(&self) -> MessageDialogBuilder<'a>
fn clone(&self) -> MessageDialogBuilder<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for MessageDialogBuilder<'a>
impl<'a> Debug for MessageDialogBuilder<'a>
source§impl<'a> Default for MessageDialogBuilder<'a>
impl<'a> Default for MessageDialogBuilder<'a>
source§fn default() -> MessageDialogBuilder<'a>
fn default() -> MessageDialogBuilder<'a>
Returns the “default value” for a type. Read more
source§impl<'a> Hash for MessageDialogBuilder<'a>
impl<'a> Hash for MessageDialogBuilder<'a>
source§impl<'a> Serialize for MessageDialogBuilder<'a>
impl<'a> Serialize for MessageDialogBuilder<'a>
impl<'a> Copy for MessageDialogBuilder<'a>
Auto Trait Implementations§
impl<'a> Freeze for MessageDialogBuilder<'a>
impl<'a> RefUnwindSafe for MessageDialogBuilder<'a>
impl<'a> Send for MessageDialogBuilder<'a>
impl<'a> Sync for MessageDialogBuilder<'a>
impl<'a> Unpin for MessageDialogBuilder<'a>
impl<'a> UnwindSafe for MessageDialogBuilder<'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> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)