pub struct Prompt {
pub text: String,
pub output_type: OutputType,
pub clock: Option<Instant>,
pub command: Option<Command>,
pub history: Vec<String>,
pub history_index: usize,
}
Expand description
Fields§
§text: String
Input/output text.
output_type: OutputType
Output type.
clock: Option<Instant>
Clock for tracking the duration of output messages.
command: Option<Command>
Command that will be confirmed for execution.
history: Vec<String>
Command history.
history_index: usize
Index of the selected command from history.
Implementations§
source§impl Prompt
impl Prompt
sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Checks if the prompt is enabled.
sourcepub fn enable_command_input(&mut self)
pub fn enable_command_input(&mut self)
Enables the command input.
sourcepub fn is_command_input_enabled(&self) -> bool
pub fn is_command_input_enabled(&self) -> bool
Checks if the command input is enabled.
sourcepub fn enable_search(&mut self)
pub fn enable_search(&mut self)
Enables the search.
sourcepub fn is_search_enabled(&self) -> bool
pub fn is_search_enabled(&self) -> bool
Checks if the search is enabled.
sourcepub fn set_output<S: AsRef<str>>(&mut self, output: (OutputType, S))
pub fn set_output<S: AsRef<str>>(&mut self, output: (OutputType, S))
Sets the output message.
sourcepub fn set_command(&mut self, command: Command)
pub fn set_command(&mut self, command: Command)
Sets the command that will be asked to confirm.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Prompt
impl RefUnwindSafe for Prompt
impl Send for Prompt
impl Sync for Prompt
impl Unpin for Prompt
impl UnwindSafe for Prompt
Blanket Implementations§
source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.