Crate kal

Source
Expand description

§kal

Command Abstraction Layer for bot libraries

Modules§

lex
The lex module provides a lexer for parsing commands. It coudl be enabled with "lex" feature flag.

Macros§

command_group
Make an enum implementing Command where its every variant have only one field implements Commnad. The enum will provide a parse function matching each variant’s name directly.

Structs§

CommaSeparated
Wrapper for Vec that separates elements by space
CommandOption
The option command cane take
CommandSpec
The specification of coomand
SpaceSeparated
Wrapper for Vec that separates elements by comma
TryFromArgumentValueError
Failed to convert CommandArgumentValue to the type expected.

Enums§

CommandArgument
Command argument
CommandArgumentValue
The actual argument value
CommandArgumentValueType
The type that command argument could be
CommandFragment
The fragment of user command
CommandOptionValueKind
The kind of value option can take
CommandParseError
An error made while parsing command from CommandFragment.

Traits§

Command
The command
CommandOptionValueTy
Associate Rust type with CommandOptionValueKind and provide Rust side default value.
TryFromArgumentValue
The trait to convert CommandArgumentValue to the type expected.

Derive Macros§

Command
Derive Command trait from kal for a struct or an enum.