pub struct Boolean { /* private fields */ }Implementations§
Source§impl Boolean
impl Boolean
pub fn new(message: String) -> Self
pub fn with_formatter( &mut self, formatter: impl ConfirmFormatter + 'static, ) -> &mut Self
pub fn with_hint(&mut self, hint: impl Display) -> &mut Self
pub fn with_default(&mut self, value: bool) -> &mut Self
Trait Implementations§
Source§impl Prompt for Boolean
impl Prompt for Boolean
Source§fn setup(&mut self) -> Result<(), Error>
fn setup(&mut self) -> Result<(), Error>
Sets up the prompt.
A lifecycle method for validating and initializing settings.
A lifecycle method for validating and initializing settings.
Source§fn handle(&mut self, code: KeyCode, modifiers: KeyModifiers) -> PromptState
fn handle(&mut self, code: KeyCode, modifiers: KeyModifiers) -> PromptState
Handles key presses.
Allows changing the internal state of the prompt in response to key inputs.
Allows changing the internal state of the prompt in response to key inputs.
Source§fn submit(&mut self) -> Self::Output
fn submit(&mut self) -> Self::Output
Submits the prompt.
Called as a result of
Called as a result of
Prompt::handle returning PromptState::Submit, it returns the final value.Source§fn render(&mut self, state: &PromptState) -> Result<RenderPayload, String>
fn render(&mut self, state: &PromptState) -> Result<RenderPayload, String>
Renders the prompt.
Performs rendering based on the value of
If returning an error, please return the error message as a
Performs rendering based on the value of
PromptState.If returning an error, please return the error message as a
String.Auto Trait Implementations§
impl !RefUnwindSafe for Boolean
impl !Send for Boolean
impl !Sync for Boolean
impl !UnwindSafe for Boolean
impl Freeze for Boolean
impl Unpin for Boolean
impl UnsafeUnpin for Boolean
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