pub struct ConfirmDialog {
pub visible: bool,
pub title: String,
pub message: String,
pub selected_yes: bool,
}Expand description
A simple yes/no confirmation dialog.
Fields§
§visible: bool§title: String§message: String§selected_yes: boolImplementations§
Source§impl ConfirmDialog
impl ConfirmDialog
pub fn new() -> Self
Sourcepub fn show(&mut self, title: impl Into<String>, message: impl Into<String>)
pub fn show(&mut self, title: impl Into<String>, message: impl Into<String>)
Show the dialog with a custom title and message.
Sourcepub fn handle_key(&mut self, key: KeyEvent) -> Option<bool>
pub fn handle_key(&mut self, key: KeyEvent) -> Option<bool>
Handle a key event. Returns Some(true) for yes, Some(false) for no,
None if still undecided.
Trait Implementations§
Source§impl Debug for ConfirmDialog
impl Debug for ConfirmDialog
Auto Trait Implementations§
impl Freeze for ConfirmDialog
impl RefUnwindSafe for ConfirmDialog
impl Send for ConfirmDialog
impl Sync for ConfirmDialog
impl Unpin for ConfirmDialog
impl UnsafeUnpin for ConfirmDialog
impl UnwindSafe for ConfirmDialog
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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