pub struct Dialog { /* private fields */ }
Expand description
Modal dialog component
Implementations§
Source§impl Dialog
impl Dialog
Sourcepub fn confirmation(title: String, message: String, theme: &dyn Theme) -> Self
pub fn confirmation(title: String, message: String, theme: &dyn Theme) -> Self
Create a new confirmation dialog
Sourcepub fn input(
title: String,
prompt: String,
default_value: String,
theme: &dyn Theme,
) -> Self
pub fn input( title: String, prompt: String, default_value: String, theme: &dyn Theme, ) -> Self
Create a new input dialog
Sourcepub fn selection(
title: String,
message: String,
options: Vec<String>,
theme: &dyn Theme,
) -> Self
pub fn selection( title: String, message: String, options: Vec<String>, theme: &dyn Theme, ) -> Self
Create a new selection dialog
Sourcepub fn file_picker(
title: String,
current_path: String,
filter: Option<String>,
theme: &dyn Theme,
) -> Self
pub fn file_picker( title: String, current_path: String, filter: Option<String>, theme: &dyn Theme, ) -> Self
Create a new file picker dialog
Sourcepub async fn handle_key_event(
&mut self,
key: KeyEvent,
) -> Result<Option<DialogResult>>
pub async fn handle_key_event( &mut self, key: KeyEvent, ) -> Result<Option<DialogResult>>
Handle key events, returning the result if dialog is completed
Auto Trait Implementations§
impl Freeze for Dialog
impl !RefUnwindSafe for Dialog
impl Send for Dialog
impl Sync for Dialog
impl Unpin 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
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