pub struct Alert {
pub title: String,
pub message: Option<String>,
pub buttons: Vec<String>,
pub style: AlertStyle,
pub destructive: Option<usize>,
}Expand description
A message with buttons. The reply is the index of the chosen button.
Fields§
§title: String§message: Option<String>In order of importance: the first is the default (Return) button.
style: AlertStyle§destructive: Option<usize>The button that destroys something (Delete, Discard), drawn as destructive where the platform’s alerts draw one.
Implementations§
Source§impl Alert
impl Alert
pub fn new(title: impl Into<String>) -> Alert
pub fn message(self, message: impl Into<String>) -> Alert
A button, after the others, that destroys something: TextEdit’s Delete when closing a document never saved.
pub fn style(self, style: AlertStyle) -> Alert
The buttons to show: “OK”, in the app’s language, when none were given.
Trait Implementations§
impl StructuralPartialEq for Alert
Auto Trait Implementations§
impl Forget for Alert
impl Freeze for Alert
impl Move for Alert
impl RefUnwindSafe for Alert
impl Send for Alertwhere
RawVecInner: Send,
impl Sync for Alertwhere
RawVecInner: Sync,
impl Unpin for Alert
impl UnsafeUnpin for Alertwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for Alertwhere
RawVecInner: UnwindSafe,
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