rustpython::shell::rustyline_helper::ShellHelper - Rust
impl<'vm> ShellHelper<'vm>[src]
pub fn new(vm: &'vm VirtualMachine, scope: Scope) -> Self[src]
fn get_available_completions<'w>(
&self,
words: &'w [String]
) -> Option<(&'w str, Box<dyn Iterator<Item = PyResult<PyStringRef>> + 'vm>)>[src]
&self,
words: &'w [String]
) -> Option<(&'w str, Box<dyn Iterator<Item = PyResult<PyStringRef>> + 'vm>)>
fn complete_opt(&self, line: &str) -> Option<(usize, Vec<String>)>[src]
impl<'_> Completer for ShellHelper<'_>[src]
type Candidate = String
fn complete(
&self,
line: &str,
pos: usize,
_ctx: &Context
) -> Result<(usize, Vec<String>)>[src]
&self,
line: &str,
pos: usize,
_ctx: &Context
) -> Result<(usize, Vec<String>)>
Takes the currently edited line with the cursor position and returns the start position and the completion candidates for the partial word to be completed. Read more
fn update(&self, line: &mut LineBuffer, start: usize, elected: &str)
Updates the edited line with the elected candidate.
impl<'_> Helper for ShellHelper<'_>[src]
impl<'_> Highlighter for ShellHelper<'_>[src]
fn highlight(&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 more
fn highlight_prompt<'b, 's, 'p>(
&'s self,
prompt: &'p str,
default: bool
) -> Cow<'b, str> where
's: 'b,
'p: 'b,
&'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). Read more
fn highlight_hint(&self, hint: &'h str) -> Cow<'h, str>
Takes the hint and returns the highlighted version (with ANSI color). Read more
fn highlight_candidate(
&self,
candidate: &'c str,
completion: CompletionType
) -> Cow<'c, str>
&self,
candidate: &'c str,
completion: CompletionType
) -> Cow<'c, str>
Takes the completion candidate and returns the highlighted version (with ANSI color). Read more
fn highlight_char(&self, line: &str, pos: usize) -> bool
Tells if line needs to be highlighted when a specific char is typed or when cursor is moved under a specific char. Read more
impl<'_> Hinter for ShellHelper<'_>[src]
fn hint(&self, line: &str, pos: usize, ctx: &Context) -> Option<String>
Takes the currently edited line with the cursor position and returns the string that should be displayed or None if no hint is available for the text the user currently typed. Read more
impl<'_> Validator for ShellHelper<'_>[src]
fn validate(
&self,
ctx: &mut ValidationContext
) -> Result<ValidationResult, ReadlineError>
&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 more
fn validate_while_typing(&self) -> bool
Configure whether validation is performed while typing or only when user presses the Enter key. Read more
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,