Trait CommandArg

Source
pub trait CommandArg: Sized {
    // Required methods
    fn parse_arg(
        input: &mut ParseInput<'_>,
    ) -> Result<Self, CommandArgParseError>;
    fn display() -> Parser;

    // Provided method
    fn arg_from_str(string: &str) -> Result<Self, CommandArgParseError> { ... }
}

Required Methods§

Source

fn parse_arg(input: &mut ParseInput<'_>) -> Result<Self, CommandArgParseError>

Source

fn display() -> Parser

what will the client be sent

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl CommandArg for GameMode

Source§

impl CommandArg for Color

Source§

impl CommandArg for bool

Source§

impl CommandArg for f32

Source§

impl CommandArg for f64

Source§

impl CommandArg for i32

Source§

impl CommandArg for i64

Source§

impl CommandArg for u32

Source§

impl CommandArg for String

Implementors§