GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • rustpython
  • shell
  • rustyline_helper

This view

  • Original page
  • New address

GeezerVison is showing rustpython.github.io — rustpython::shell::rustyline_helper::ShellHelper - Rust

[−][src]Struct rustpython::shell::rustyline_helper::ShellHelper

pub struct ShellHelper<'vm> {
    vm: &'vm VirtualMachine,
    scope: Scope,
}

Fields

vm: &'vm VirtualMachinescope: Scope

Methods

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]

fn complete_opt(&self, line: &str) -> Option<(usize, Vec<String>)>[src]

Trait Implementations

impl<'_> Completer for ShellHelper<'_>[src]

type Candidate = String

fn complete(
    &self,
    line: &str,
    pos: usize,
    _ctx: &Context
) -> Result<(usize, Vec<String>)>
[src]

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, 

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>

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>

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

Auto Trait Implementations

impl<'vm> !RefUnwindSafe for ShellHelper<'vm>

impl<'vm> !Send for ShellHelper<'vm>

impl<'vm> !Sync for ShellHelper<'vm>

impl<'vm> Unpin for ShellHelper<'vm>

impl<'vm> !UnwindSafe for ShellHelper<'vm>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

fn into(self) -> U[src]

Performs the conversion.

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]

type Error = Infallible

The type returned in the event of a conversion error.

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

fn vzip(self) -> V

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.