Crate docbot

Source
Expand description

Create a chatbot command interface using a docopt-like API

Re-exports§

pub use anyhow::Error as Anyhow;

Modules§

prelude
Common traits and types used with this crate

Structs§

ArgumentDesc
Detailed description of a command argument
ArgumentName
Identifies an argument to a command
ArgumentUsage
Usage description for an argument
CommandDesc
Detailed description of a command
CommandUsage
Usage description for a command
SimpleFoldError
A basic implementation of FoldError that outputs a string describing the error.
SimpleFoldHelp
A basic implementation of FoldHelp outputting multiline strings akin to POSIX command help text.

Enums§

CommandParseError
Error type for failures when parsing a command
Downcast
Helper for downcasting anyhow::Error into possible docbot errors
HelpTopic
A generic help topic
IdParseError
Error type for failures when parsing a command ID
PathParseError
Error type for failures when parsing a command path

Traits§

Command
A parsable, identifiable command or family of commands
CommandId
A command ID, convertible to and from a string
CommandPath
A chain of command IDs representing a command or subcommand
FoldError
Helper trait for processing and formatting errors from docbot
FoldHelp
Helper trait for processing and formatting help topics from docbot
Help
A command with associated help topics

Functions§

did_you_mean
Rank a list of options by their similarity to the given input. Contains some basic heuristics tailored towards the Docbot parser.
tokenize_str_simple
Performs simple tokenization of a string with minimal support for single- and double-quoting

Derive Macros§

Docbot
Construct a new command or set of commands from doc comments