Trait rustyline::hint::Hinter

source ·
pub trait Hinter {
    type Hint: Hint + 'static;

    // Provided method
    fn hint(
        &self,
        line: &str,
        pos: usize,
        ctx: &Context<'_>,
    ) -> Option<Self::Hint> { ... }
}
Expand description

Hints provider

Required Associated Types§

source

type Hint: Hint + 'static

Specific hint type

Provided Methods§

source

fn hint(&self, line: &str, pos: usize, ctx: &Context<'_>) -> Option<Self::Hint>

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.

Implementations on Foreign Types§

source§

impl Hinter for ()

§

type Hint = String

source§

impl<'r, H: ?Sized + Hinter> Hinter for &'r H

§

type Hint = <H as Hinter>::Hint

source§

fn hint(&self, line: &str, pos: usize, ctx: &Context<'_>) -> Option<Self::Hint>

Implementors§