Skip to main content

CommandArgumentParser

Trait CommandArgumentParser 

Source
pub(crate) trait CommandArgumentParser<S>:
    PartialEq
    + Send
    + Sync
    + 'static {
    type Value: Clone + Send + Sync + 'static;

    // Required methods
    fn parse(
        &self,
        reader: &mut StringReader<'_>,
        source: &S,
    ) -> Result<Self::Value, CommandSyntaxError>;
    fn list_suggestions(
        &self,
        context: &ArgumentSuggestionContext<'_, S, Self::Value>,
        builder: &mut SuggestionsBuilder<'_>,
    );
}
Expand description

A parser and parsed-value representation stored by one command runtime.

Required Associated Types§

Source

type Value: Clone + Send + Sync + 'static

The value retained in the parsed command context.

Required Methods§

Source

fn parse( &self, reader: &mut StringReader<'_>, source: &S, ) -> Result<Self::Value, CommandSyntaxError>

Parses one value from the reader at its current cursor.

Source

fn list_suggestions( &self, context: &ArgumentSuggestionContext<'_, S, Self::Value>, builder: &mut SuggestionsBuilder<'_>, )

Adds completions for a partially entered value.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§