Enum slashy::argument::Argument[][src]

pub enum Argument {
    String(String),
    Integer(i32),
    Boolean(bool),
    User(UserId),
    Channel(ChannelId),
    Role(RoleId),
}
Expand description

Represents the argument data sent into commands

Variants

String(String)
Integer(i32)
Boolean(bool)
User(UserId)
Channel(ChannelId)
Role(RoleId)

Implementations

Traverses the argument tree of cmd and outputs a map of arguments and the function to run

Parses InteractionOptions into Argument and gets the function pointer for the node we need to run

Splits a raw string into argument words respecting quotation marks

let string = r#"this is a string "with quotes in it""#;

let args = Argument::get_arg_strings(string);
assert_eq!(args, vec!["this","is","a","string","with quotes in it"]);

Takes a string and traverses the arguments tree to get a argument map and function to run

Trait Implementations

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.