[][src]Struct xcli::PrefixCompleter

pub struct PrefixCompleter { /* fields omitted */ }

A PrefixCompleter for subcommands

Implementations

impl PrefixCompleter[src]

pub fn new(cmd_tree: &Command<'_>) -> Self[src]

Constructor, take the command tree as input

pub fn complete_cmd(
    &self,
    line: &str,
    pos: usize
) -> 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 path to be completed.

pub fn _complete_cmd(node: &PrefixNode, line: &str, pos: usize) -> Vec<String>[src]

Get all commands that match the line and pos

Trait Implementations

impl Completer for PrefixCompleter[src]

type Candidate = String

Specific completion candidate.

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

Complete command

impl Helper for PrefixCompleter[src]

impl Highlighter for PrefixCompleter[src]

impl Hinter for PrefixCompleter[src]

impl Validator for PrefixCompleter[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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.

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.