pub struct NarjuHelper {
pub completer: FilenameCompleter,
pub hinter: HistoryHinter,
}Expand description
The rustyline helper for the raw λ↑↓ REPL: syntax highlighting,
filename completion (for :load), history hints, and bracket
validation.
Fields§
§completer: FilenameCompleterCompletes filenames, for :load arguments.
hinter: HistoryHinterOffers the rest of a matching history entry as a dimmed hint.
Trait Implementations§
Source§impl Completer for NarjuHelper
impl Completer for NarjuHelper
Source§impl Highlighter for NarjuHelper
impl Highlighter for NarjuHelper
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_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).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§impl Hinter for NarjuHelper
impl Hinter for NarjuHelper
Source§impl Validator for NarjuHelper
Bracket-balance validator — waits for balanced parens before submitting.
impl Validator for NarjuHelper
Bracket-balance validator — waits for balanced parens before submitting.
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 NarjuHelper
Auto Trait Implementations§
impl Freeze for NarjuHelper
impl RefUnwindSafe for NarjuHelper
impl Send for NarjuHelper
impl Sync for NarjuHelper
impl Unpin for NarjuHelper
impl UnwindSafe for NarjuHelper
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