Skip to main content

SteelArgumentParser

Trait SteelArgumentParser 

Source
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§

Source

type Value: DowncastType + Debug + Send + Sync + 'static

Concrete value produced by this parser.

Required Methods§

Source

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

Parses one value from the command reader.

Source

fn protocol_argument( &self, ) -> (ProtocolArgumentType, Option<ProtocolSuggestionType>)

Returns the vanilla command-tree parser representation.

Provided Methods§

Source

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".

Implementors§

Source§

impl SteelArgumentParser for BiomeOrTagParser

Source§

impl SteelArgumentParser for BlockPosParser

Source§

impl SteelArgumentParser for BlockPredicateParser

Source§

impl SteelArgumentParser for BlockStateParser

Source§

impl SteelArgumentParser for ComponentParser

Source§

impl SteelArgumentParser for DamageTypeParser

Source§

impl SteelArgumentParser for DomainParser

Source§

impl SteelArgumentParser for EnchantmentParser

Source§

impl SteelArgumentParser for EntityAnchorParser

Source§

impl SteelArgumentParser for EntityParser

Source§

impl SteelArgumentParser for GameModeParser

Source§

impl SteelArgumentParser for GameProfileParser

Source§

impl SteelArgumentParser for HeightmapParser

Source§

impl SteelArgumentParser for IntRangeParser

Source§

impl SteelArgumentParser for ItemPredicateParser

Source§

impl SteelArgumentParser for ItemStackParser

Source§

impl SteelArgumentParser for NbtPathParser

Source§

impl SteelArgumentParser for ObjectiveParser

Source§

impl SteelArgumentParser for PermissionGroupParser

Source§

impl SteelArgumentParser for PermissionMetadataParser

Source§

impl SteelArgumentParser for PermissionRuleParser

Source§

impl SteelArgumentParser for PrimitiveParser

Source§

impl SteelArgumentParser for RotationParser

Source§

impl SteelArgumentParser for ScoreHolderParser

Source§

impl SteelArgumentParser for StorageKeyParser

Source§

impl SteelArgumentParser for StructureOrTagKeyParser

Source§

impl SteelArgumentParser for SummonableEntityParser

Source§

impl SteelArgumentParser for SwizzleParser

Source§

impl SteelArgumentParser for TimeMarkerParser

Source§

impl SteelArgumentParser for TimeParser

Source§

impl SteelArgumentParser for TimelineParser

Source§

impl SteelArgumentParser for Vec3Parser

Source§

impl SteelArgumentParser for WorldClockParser

Source§

impl SteelArgumentParser for WorldParser

Source§

impl<P> SteelArgumentParser for P