pub trait CommandArgumentParser:
DowncastType
+ Debug
+ PartialEq
+ Send
+ Sync
+ 'static {
type Value: DowncastType + Debug + Send + Sync + 'static;
// Required methods
fn parse(
&self,
reader: &mut CommandReader<'_, '_>,
source: CommandParserSource<'_>,
) -> Result<Self::Value, CommandError>;
fn protocol_argument(
&self,
) -> (ProtocolArgumentType, Option<ProtocolSuggestionType>);
// Provided method
fn list_suggestions(
&self,
_context: CommandSuggestionContext<'_>,
_suggestions: &mut CommandSuggestions<'_, '_>,
) { ... }
}Expand description
Typed, deterministically keyed parser contract for extension arguments.
Required Associated Types§
Required Methods§
Sourcefn parse(
&self,
reader: &mut CommandReader<'_, '_>,
source: CommandParserSource<'_>,
) -> Result<Self::Value, CommandError>
fn parse( &self, reader: &mut CommandReader<'_, '_>, source: CommandParserSource<'_>, ) -> Result<Self::Value, CommandError>
Parses one value from the reader’s current cursor.
Sourcefn protocol_argument(
&self,
) -> (ProtocolArgumentType, Option<ProtocolSuggestionType>)
fn protocol_argument( &self, ) -> (ProtocolArgumentType, Option<ProtocolSuggestionType>)
Returns the vanilla command-tree parser and optional server suggestion provider.
Provided Methods§
Sourcefn list_suggestions(
&self,
_context: CommandSuggestionContext<'_>,
_suggestions: &mut CommandSuggestions<'_, '_>,
)
fn list_suggestions( &self, _context: CommandSuggestionContext<'_>, _suggestions: &mut CommandSuggestions<'_, '_>, )
Adds context-aware 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".