Struct commands::parser::Completion [] [src]

pub struct Completion<'text> {
    pub help_symbol: String,
    pub help_text: String,
    pub token: Option<Token<'text>>,
    pub exhaustive: bool,
    pub options: Vec<CompletionOption>,
}

Represents the result of completing a node. Each valid completion is represented by a CompletionOption.

This may be hinted by a pre-existing token.

If a completion is exhaustive, then only the CompletionOptions provided are valid.

The lifetime parameter 'text refers to the lifetime of the body of text which generated the Token.

Fields

help_symbol

Value placeholder for help.

help_text

Main help text.

token

Token used to hint the completion, if provided.

exhaustive

Was this completion exhaustive? If yes, then only the given completion options are valid.

options

The actual completion options.

Methods

impl<'text> Completion<'text>

fn new(help_symbol: String, help_text: String, token: Option<Token<'text>>, exhaustive: bool, complete_options: Vec<&str>, other_options: Vec<&str>) -> Completion<'text>

Construct a new Completion.