Struct rpn_cli::helper::CommandHelper
source · pub struct CommandHelper { /* private fields */ }Implementations§
source§impl CommandHelper
impl CommandHelper
pub fn new(commands: Vec<String>) -> CommandHelper
Trait Implementations§
source§impl Completer for CommandHelper
impl Completer for CommandHelper
source§impl Highlighter for CommandHelper
impl Highlighter for CommandHelper
source§fn highlight<'l>(&self, line: &'l str, pos: usize) -> Cow<'l, str>
fn highlight<'l>(&self, line: &'l str, pos: usize) -> Cow<'l, str>
Takes the currently edited
line with the cursor position and
returns the highlighted version (with ANSI color). Read moresource§fn highlight_prompt<'b, 's, 'p>(
&'s self,
prompt: &'p str,
default: bool
) -> Cow<'b, str>where
's: 'b,
'p: 'b,
fn highlight_prompt<'b, 's, 'p>(
&'s self,
prompt: &'p str,
default: bool
) -> Cow<'b, str>where
's: 'b,
'p: 'b,
Takes the
prompt and
returns the highlighted version (with ANSI color).source§fn highlight_hint<'h>(&self, hint: &'h str) -> Cow<'h, str>
fn highlight_hint<'h>(&self, hint: &'h str) -> Cow<'h, str>
Takes the
hint and
returns the highlighted version (with ANSI color).source§fn highlight_candidate<'c>(
&self,
candidate: &'c str,
completion: CompletionType
) -> Cow<'c, str>
fn highlight_candidate<'c>( &self, candidate: &'c str, completion: CompletionType ) -> Cow<'c, str>
Takes the completion
candidate and
returns the highlighted version (with ANSI color). Read moresource§impl Hinter for CommandHelper
impl Hinter for CommandHelper
source§impl Validator for CommandHelper
impl Validator for CommandHelper
source§fn validate(
&self,
ctx: &mut ValidationContext<'_>
) -> Result<ValidationResult, ReadlineError>
fn validate( &self, ctx: &mut ValidationContext<'_> ) -> Result<ValidationResult, ReadlineError>
Takes the currently edited
input and returns a
ValidationResult indicating whether it is valid or not along
with an option message to display about the result. The most
common validity check to implement is probably whether the
input is complete or not, for instance ensuring that all
delimiters are fully balanced. Read moresource§fn validate_while_typing(&self) -> bool
fn validate_while_typing(&self) -> bool
Configure whether validation is performed while typing or only
when user presses the Enter key. Read more
impl Helper for CommandHelper
Auto Trait Implementations§
impl RefUnwindSafe for CommandHelper
impl Send for CommandHelper
impl Sync for CommandHelper
impl Unpin for CommandHelper
impl UnwindSafe for CommandHelper
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.