Crate kal

source · []
Expand description

kal

Command Abstraction Layer for bot libraries

Modules

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

Macros

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

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

Enums

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

Traits

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

Derive Macros

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