pub struct Dialog { /* private fields */ }Expand description
Represents a browser dialog
Implementations§
Source§impl Dialog
impl Dialog
Sourcepub fn new(dialog_type: DialogType, message: impl Into<String>) -> Self
pub fn new(dialog_type: DialogType, message: impl Into<String>) -> Self
Create a new dialog
Sourcepub fn prompt(message: impl Into<String>, default: Option<String>) -> Self
pub fn prompt(message: impl Into<String>, default: Option<String>) -> Self
Create a prompt dialog
Sourcepub fn before_unload(message: impl Into<String>) -> Self
pub fn before_unload(message: impl Into<String>) -> Self
Create a beforeunload dialog
Sourcepub fn dialog_type(&self) -> DialogType
pub fn dialog_type(&self) -> DialogType
Get dialog type
Sourcepub fn default_value(&self) -> Option<&str>
pub fn default_value(&self) -> Option<&str>
Get default value (for prompts)
Sourcepub fn action(&self) -> &DialogAction
pub fn action(&self) -> &DialogAction
Get action taken
Sourcepub fn is_handled(&self) -> bool
pub fn is_handled(&self) -> bool
Check if dialog was handled
Sourcepub fn accept_with(&mut self, text: impl Into<String>)
pub fn accept_with(&mut self, text: impl Into<String>)
Accept the dialog with input text (for prompts)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Dialog
impl<'de> Deserialize<'de> for Dialog
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Dialog
impl RefUnwindSafe for Dialog
impl Send for Dialog
impl Sync for Dialog
impl Unpin for Dialog
impl UnsafeUnpin for Dialog
impl UnwindSafe for Dialog
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