pub struct NarjuHelperLite;Expand description
The rustyline helper for the Purple REPL: highlighting and bracket validation only. See the comment block above for why completion and hinting are stubbed out.
Trait Implementations§
Source§impl Completer for NarjuHelperLite
impl Completer for NarjuHelperLite
Source§impl Highlighter for NarjuHelperLite
impl Highlighter for NarjuHelperLite
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_char(&self, _line: &str, _pos: usize, _forced: bool) -> bool
fn highlight_char(&self, _line: &str, _pos: usize, _forced: bool) -> bool
Tells if
line needs to be highlighted when a specific char is typed or
when cursor is moved under a specific char.
forced flag is true mainly when user presses Enter (i.e. transient
vs final highlight). Read moreSource§fn highlight_prompt<'b, 's: 'b, 'p: 'b>(
&'s self,
prompt: &'p str,
_default: bool,
) -> Cow<'b, str>
fn highlight_prompt<'b, 's: 'b, 'p: 'b>( &'s self, prompt: &'p str, _default: bool, ) -> Cow<'b, str>
Takes the
prompt and
returns the highlighted version (with ANSI color).§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§impl Hinter for NarjuHelperLite
impl Hinter for NarjuHelperLite
Source§impl Validator for NarjuHelperLite
impl Validator for NarjuHelperLite
Source§fn validate(&self, ctx: &mut ValidationContext<'_>) -> Result<ValidationResult>
fn validate(&self, ctx: &mut ValidationContext<'_>) -> Result<ValidationResult>
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 more§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 NarjuHelperLite
Auto Trait Implementations§
impl Freeze for NarjuHelperLite
impl RefUnwindSafe for NarjuHelperLite
impl Send for NarjuHelperLite
impl Sync for NarjuHelperLite
impl Unpin for NarjuHelperLite
impl UnwindSafe for NarjuHelperLite
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