pub(crate) trait SteelArgumentParser:
DowncastType
+ Debug
+ PartialEq
+ Send
+ Sync
+ 'static {
type Value: DowncastType + Debug + Send + Sync + 'static;
// Required methods
fn parse(
&self,
reader: &mut StringReader<'_>,
source: &dyn CommandArgumentSource,
) -> Result<Self::Value, CommandSyntaxError>;
fn protocol_argument(
&self,
) -> (ProtocolArgumentType, Option<ProtocolSuggestionType>);
// Provided method
fn list_suggestions(
&self,
_context: &dyn SteelArgumentSuggestionContext,
_builder: &mut SuggestionsBuilder<'_>,
) { ... }
}Expand description
Typed parser contract erased by SteelArgumentType.
Required Associated Types§
Required Methods§
Sourcefn parse(
&self,
reader: &mut StringReader<'_>,
source: &dyn CommandArgumentSource,
) -> Result<Self::Value, CommandSyntaxError>
fn parse( &self, reader: &mut StringReader<'_>, source: &dyn CommandArgumentSource, ) -> Result<Self::Value, CommandSyntaxError>
Parses one value from the command reader.
Sourcefn protocol_argument(
&self,
) -> (ProtocolArgumentType, Option<ProtocolSuggestionType>)
fn protocol_argument( &self, ) -> (ProtocolArgumentType, Option<ProtocolSuggestionType>)
Returns the vanilla command-tree parser representation.
Provided Methods§
Sourcefn list_suggestions(
&self,
_context: &dyn SteelArgumentSuggestionContext,
_builder: &mut SuggestionsBuilder<'_>,
)
fn list_suggestions( &self, _context: &dyn SteelArgumentSuggestionContext, _builder: &mut SuggestionsBuilder<'_>, )
Adds context-aware completion suggestions.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".