Skip to main content

Input

Trait Input 

Source
pub trait Input {
    // Required methods
    fn parsed(&self) -> bool;
    fn has_default(&self) -> bool;
    fn parse(&mut self, token: &str) -> CliResult<bool>;
    fn display_name(&self) -> String;
    fn description(&self) -> Option<String>;
    fn type_name(&self) -> InputType;
    fn is_bool_flag(&self) -> bool;
    fn complete(&mut self, value: &str) -> CliResult<Vec<String>>;
}
Expand description

parser complexities:

compound flags (-am)

optional flags

out of order flags

Required Methods§

Source

fn parsed(&self) -> bool

Source

fn has_default(&self) -> bool

Source

fn parse(&mut self, token: &str) -> CliResult<bool>

Source

fn display_name(&self) -> String

Source

fn description(&self) -> Option<String>

Source

fn type_name(&self) -> InputType

Source

fn is_bool_flag(&self) -> bool

Source

fn complete(&mut self, value: &str) -> CliResult<Vec<String>>

must not return completions that don’t start with value, otherwise bash breaks

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, T: FromStr + Clone> Input for Arg<'a, T>

Source§

impl<'a, T: FromStr + Default + Clone> Input for Flag<'a, T>