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§
Required Methods§
Sourcefn parse(
&self,
reader: &mut StringReader<'_>,
source: &S,
) -> Result<Self::Value, CommandSyntaxError>
fn parse( &self, reader: &mut StringReader<'_>, source: &S, ) -> Result<Self::Value, CommandSyntaxError>
Parses one value from the reader at its current cursor.
Sourcefn list_suggestions(
&self,
context: &ArgumentSuggestionContext<'_, S, Self::Value>,
builder: &mut SuggestionsBuilder<'_>,
)
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".