pub struct DialogState {
pub focused_button: Option<usize>,
pub input_value: String,
pub input_focused: bool,
pub open: bool,
pub result: Option<DialogResult>,
}Expand description
Dialog state for handling input and button focus.
Fields§
Currently focused button index.
input_value: StringInput field value (for Prompt dialogs).
input_focused: boolWhether the input field is focused.
open: boolWhether the dialog is open.
result: Option<DialogResult>Result after interaction.
Implementations§
Source§impl DialogState
impl DialogState
Sourcepub fn close(&mut self, result: DialogResult)
pub fn close(&mut self, result: DialogResult)
Close the dialog with a result.
Sourcepub fn take_result(&mut self) -> Option<DialogResult>
pub fn take_result(&mut self) -> Option<DialogResult>
Get the result if closed.
Trait Implementations§
Source§impl Clone for DialogState
impl Clone for DialogState
Source§fn clone(&self) -> DialogState
fn clone(&self) -> DialogState
Returns a duplicate 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 Debug for DialogState
impl Debug for DialogState
Source§impl Default for DialogState
impl Default for DialogState
Source§fn default() -> DialogState
fn default() -> DialogState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DialogState
impl RefUnwindSafe for DialogState
impl Send for DialogState
impl Sync for DialogState
impl Unpin for DialogState
impl UnwindSafe for DialogState
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