pub struct PromptDialog { /* private fields */ }Expand description
A prompt dialog with text input
Implementations§
Source§impl PromptDialog
impl PromptDialog
Sourcepub fn message(self, message: impl Into<String>) -> Self
pub fn message(self, message: impl Into<String>) -> Self
Set a message to display above the input
Sourcepub fn placeholder(self, placeholder: impl Into<String>) -> Self
pub fn placeholder(self, placeholder: impl Into<String>) -> Self
Set the placeholder text
Sourcepub fn initial_value(self, value: impl Into<String>) -> Self
pub fn initial_value(self, value: impl Into<String>) -> Self
Set the initial value
Sourcepub fn submit_text(self, text: impl Into<String>) -> Self
pub fn submit_text(self, text: impl Into<String>) -> Self
Set the submit button text
Sourcepub fn cancel_text(self, text: impl Into<String>) -> Self
pub fn cancel_text(self, text: impl Into<String>) -> Self
Set the cancel button text
Sourcepub fn show(self, ctx: &Context, open: &mut bool) -> PromptResult
pub fn show(self, ctx: &Context, open: &mut bool) -> PromptResult
Show the prompt dialog
The typed text is kept between frames while the dialog is open. Enter in a single-line input submits; Escape, the close button and a click on the backdrop cancel.
Auto Trait Implementations§
impl Freeze for PromptDialog
impl RefUnwindSafe for PromptDialog
impl Send for PromptDialog
impl Sync for PromptDialog
impl Unpin for PromptDialog
impl UnsafeUnpin for PromptDialog
impl UnwindSafe for PromptDialog
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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